summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/machdep.c22
-rw-r--r--sys/i386/i386/machdep.c22
2 files changed, 24 insertions, 20 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 41d0411..31b954a 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1774,24 +1774,23 @@ void
init386(first)
int first;
{
- int x;
struct gate_descriptor *gdp;
- int gsel_tss;
+ int gsel_tss, metadata_missing, off, x;
#ifndef SMP
/* table descriptors - used to load tables by microp */
struct region_descriptor r_gdt, r_idt;
#endif
- int off;
proc0.p_addr = proc0paddr;
atdevbase = ISA_HOLE_START + KERNBASE;
+ metadata_missing = 0;
if (bootinfo.bi_modulep) {
preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
preload_bootstrap_relocate(KERNBASE);
} else {
- printf("WARNING: loader(8) metadata is missing!\n");
+ metadata_missing = 1;
}
if (bootinfo.bi_envp)
kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
@@ -1808,18 +1807,18 @@ init386(first)
* XXX text protection is temporarily (?) disabled. The limit was
* i386_btop(round_page(etext)) - 1.
*/
- gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1;
- gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1;
+ gdt_segs[GCODE_SEL].ssd_limit = atop(0 - 1);
+ gdt_segs[GDATA_SEL].ssd_limit = atop(0 - 1);
#ifdef SMP
gdt_segs[GPRIV_SEL].ssd_limit =
- i386_btop(sizeof(struct privatespace)) - 1;
+ atop(sizeof(struct privatespace) - 1);
gdt_segs[GPRIV_SEL].ssd_base = (int) &SMP_prvspace[0];
gdt_segs[GPROC0_SEL].ssd_base =
(int) &SMP_prvspace[0].globaldata.gd_common_tss;
SMP_prvspace[0].globaldata.gd_prvspace = &SMP_prvspace[0].globaldata;
#else
gdt_segs[GPRIV_SEL].ssd_limit =
- i386_btop(sizeof(struct globaldata)) - 1;
+ atop(sizeof(struct globaldata) - 1);
gdt_segs[GPRIV_SEL].ssd_base = (int) &__globaldata;
gdt_segs[GPROC0_SEL].ssd_base =
(int) &__globaldata.gd_common_tss;
@@ -1876,8 +1875,8 @@ init386(first)
* the code segment cannot be written to directly.
*/
#define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE)
- ldt_segs[LUCODE_SEL].ssd_limit = i386_btop(VM_END_USER_R_ADDRESS) - 1;
- ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1;
+ ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_END_USER_R_ADDRESS - 1);
+ ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_END_USER_RW_ADDRESS - 1);
for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++)
ssdtosd(&ldt_segs[x], &ldt[x].sd);
@@ -1920,6 +1919,9 @@ init386(first)
*/
cninit();
+ if (metadata_missing)
+ printf("WARNING: loader(8) metadata is missing!\n");
+
#ifdef DEV_ISA
isa_defaultirq();
#endif
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 41d0411..31b954a 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -1774,24 +1774,23 @@ void
init386(first)
int first;
{
- int x;
struct gate_descriptor *gdp;
- int gsel_tss;
+ int gsel_tss, metadata_missing, off, x;
#ifndef SMP
/* table descriptors - used to load tables by microp */
struct region_descriptor r_gdt, r_idt;
#endif
- int off;
proc0.p_addr = proc0paddr;
atdevbase = ISA_HOLE_START + KERNBASE;
+ metadata_missing = 0;
if (bootinfo.bi_modulep) {
preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
preload_bootstrap_relocate(KERNBASE);
} else {
- printf("WARNING: loader(8) metadata is missing!\n");
+ metadata_missing = 1;
}
if (bootinfo.bi_envp)
kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
@@ -1808,18 +1807,18 @@ init386(first)
* XXX text protection is temporarily (?) disabled. The limit was
* i386_btop(round_page(etext)) - 1.
*/
- gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1;
- gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1;
+ gdt_segs[GCODE_SEL].ssd_limit = atop(0 - 1);
+ gdt_segs[GDATA_SEL].ssd_limit = atop(0 - 1);
#ifdef SMP
gdt_segs[GPRIV_SEL].ssd_limit =
- i386_btop(sizeof(struct privatespace)) - 1;
+ atop(sizeof(struct privatespace) - 1);
gdt_segs[GPRIV_SEL].ssd_base = (int) &SMP_prvspace[0];
gdt_segs[GPROC0_SEL].ssd_base =
(int) &SMP_prvspace[0].globaldata.gd_common_tss;
SMP_prvspace[0].globaldata.gd_prvspace = &SMP_prvspace[0].globaldata;
#else
gdt_segs[GPRIV_SEL].ssd_limit =
- i386_btop(sizeof(struct globaldata)) - 1;
+ atop(sizeof(struct globaldata) - 1);
gdt_segs[GPRIV_SEL].ssd_base = (int) &__globaldata;
gdt_segs[GPROC0_SEL].ssd_base =
(int) &__globaldata.gd_common_tss;
@@ -1876,8 +1875,8 @@ init386(first)
* the code segment cannot be written to directly.
*/
#define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE)
- ldt_segs[LUCODE_SEL].ssd_limit = i386_btop(VM_END_USER_R_ADDRESS) - 1;
- ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1;
+ ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_END_USER_R_ADDRESS - 1);
+ ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_END_USER_RW_ADDRESS - 1);
for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++)
ssdtosd(&ldt_segs[x], &ldt[x].sd);
@@ -1920,6 +1919,9 @@ init386(first)
*/
cninit();
+ if (metadata_missing)
+ printf("WARNING: loader(8) metadata is missing!\n");
+
#ifdef DEV_ISA
isa_defaultirq();
#endif
OpenPOWER on IntegriCloud