103
103
#include <asm/setup.h>
105
static struct resource code_resource = {
106
.name = "Kernel code",
107
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
110
static struct resource data_resource = {
111
.name = "Kernel data",
112
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
116
106
* condev= and conmode= setup parameter.
316
306
static int __init early_parse_switch_amode(char *p)
318
if (user_mode != SECONDARY_SPACE_MODE)
319
user_mode = PRIMARY_SPACE_MODE;
308
user_mode = PRIMARY_SPACE_MODE;
322
311
early_param("switch_amode", early_parse_switch_amode);
326
315
if (p && strcmp(p, "primary") == 0)
327
316
user_mode = PRIMARY_SPACE_MODE;
328
#ifdef CONFIG_S390_EXEC_PROTECT
329
else if (p && strcmp(p, "secondary") == 0)
330
user_mode = SECONDARY_SPACE_MODE;
332
317
else if (!p || strcmp(p, "home") == 0)
333
318
user_mode = HOME_SPACE_MODE;
338
323
early_param("user_mode", early_parse_user_mode);
340
#ifdef CONFIG_S390_EXEC_PROTECT
342
* Enable execute protection?
344
static int __init early_parse_noexec(char *p)
346
if (!strncmp(p, "off", 3))
348
user_mode = SECONDARY_SPACE_MODE;
351
early_param("noexec", early_parse_noexec);
352
#endif /* CONFIG_S390_EXEC_PROTECT */
354
325
static void setup_addressing_mode(void)
356
if (user_mode == SECONDARY_SPACE_MODE) {
357
if (set_amode_and_uaccess(PSW_ASC_SECONDARY,
358
PSW32_ASC_SECONDARY))
359
pr_info("Execute protection active, "
360
"mvcos available\n");
362
pr_info("Execute protection active, "
363
"mvcos not available\n");
364
} else if (user_mode == PRIMARY_SPACE_MODE) {
327
if (user_mode == PRIMARY_SPACE_MODE) {
365
328
if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY))
366
329
pr_info("Address spaces switched, "
367
330
"mvcos available\n");
436
399
lowcore_ptr[0] = lc;
440
setup_resources(void)
402
static struct resource code_resource = {
403
.name = "Kernel code",
404
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
407
static struct resource data_resource = {
408
.name = "Kernel data",
409
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
412
static struct resource bss_resource = {
413
.name = "Kernel bss",
414
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
417
static struct resource __initdata *standard_resources[] = {
423
static void __init setup_resources(void)
442
struct resource *res, *sub_res;
425
struct resource *res, *std_res, *sub_res;
445
428
code_resource.start = (unsigned long) &_text;
446
429
code_resource.end = (unsigned long) &_etext - 1;
447
430
data_resource.start = (unsigned long) &_etext;
448
431
data_resource.end = (unsigned long) &_edata - 1;
432
bss_resource.start = (unsigned long) &__bss_start;
433
bss_resource.end = (unsigned long) &__bss_stop - 1;
450
435
for (i = 0; i < MEMORY_CHUNKS; i++) {
451
436
if (!memory_chunk[i].size)
453
res = alloc_bootmem_low(sizeof(struct resource));
438
res = alloc_bootmem_low(sizeof(*res));
454
439
res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
455
440
switch (memory_chunk[i].type) {
456
441
case CHUNK_READ_WRITE:
464
449
res->name = "reserved";
466
451
res->start = memory_chunk[i].addr;
467
res->end = memory_chunk[i].addr + memory_chunk[i].size - 1;
452
res->end = res->start + memory_chunk[i].size - 1;
468
453
request_resource(&iomem_resource, res);
470
if (code_resource.start >= res->start &&
471
code_resource.start <= res->end &&
472
code_resource.end > res->end) {
473
sub_res = alloc_bootmem_low(sizeof(struct resource));
474
memcpy(sub_res, &code_resource,
475
sizeof(struct resource));
476
sub_res->end = res->end;
477
code_resource.start = res->end + 1;
478
request_resource(res, sub_res);
481
if (code_resource.start >= res->start &&
482
code_resource.start <= res->end &&
483
code_resource.end <= res->end)
484
request_resource(res, &code_resource);
486
if (data_resource.start >= res->start &&
487
data_resource.start <= res->end &&
488
data_resource.end > res->end) {
489
sub_res = alloc_bootmem_low(sizeof(struct resource));
490
memcpy(sub_res, &data_resource,
491
sizeof(struct resource));
492
sub_res->end = res->end;
493
data_resource.start = res->end + 1;
494
request_resource(res, sub_res);
497
if (data_resource.start >= res->start &&
498
data_resource.start <= res->end &&
499
data_resource.end <= res->end)
500
request_resource(res, &data_resource);
455
for (j = 0; j < ARRAY_SIZE(standard_resources); j++) {
456
std_res = standard_resources[j];
457
if (std_res->start < res->start ||
458
std_res->start > res->end)
460
if (std_res->end > res->end) {
461
sub_res = alloc_bootmem_low(sizeof(*sub_res));
463
sub_res->end = res->end;
464
std_res->start = res->end + 1;
465
request_resource(res, sub_res);
467
request_resource(res, std_res);
712
681
* and 1ULL<<0 as bit 63. Bits 0-31 contain the same information
713
682
* as stored by stfl, bits 32-xxx contain additional facilities.
714
683
* How many facility words are stored depends on the number of
715
* doublewords passed to the instruction. The additional facilites
684
* doublewords passed to the instruction. The additional facilities
717
686
* Bit 42: decimal floating point facility is installed
718
687
* Bit 44: perform floating point operation facility is installed