summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-08-23 01:42:21 +0000
committerpeter <peter@FreeBSD.org>2001-08-23 01:42:21 +0000
commit8e8addf4247993f14df0ace25122aebaacb1f878 (patch)
treed9523e46a2ef50d2096f364dd9528989539c100f /sys
parent0e5d70abed52b4986207aab177f88f8c9d12b2d2 (diff)
downloadFreeBSD-src-8e8addf4247993f14df0ace25122aebaacb1f878.zip
FreeBSD-src-8e8addf4247993f14df0ace25122aebaacb1f878.tar.gz
Merge 386/machdep.c rev 1.467: fix bugs/miscalculations
Forgotten by: iwasaki
Diffstat (limited to 'sys')
-rw-r--r--sys/pc98/i386/machdep.c22
-rw-r--r--sys/pc98/pc98/machdep.c22
2 files changed, 24 insertions, 20 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 75b9110..9c68047 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -1842,14 +1842,12 @@ 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;
@@ -1862,11 +1860,12 @@ init386(first)
pc98_init_dmac();
#endif
+ 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;
@@ -1883,18 +1882,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;
@@ -1951,8 +1950,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);
@@ -1995,6 +1994,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/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 75b9110..9c68047 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -1842,14 +1842,12 @@ 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;
@@ -1862,11 +1860,12 @@ init386(first)
pc98_init_dmac();
#endif
+ 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;
@@ -1883,18 +1882,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;
@@ -1951,8 +1950,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);
@@ -1995,6 +1994,9 @@ init386(first)
*/
cninit();
+ if (metadata_missing)
+ printf("WARNING: loader(8) metadata is missing!\n");
+
#ifdef DEV_ISA
isa_defaultirq();
#endif
OpenPOWER on IntegriCloud