Upgrade to GCC 2.X
This commit is contained in:
parent
03bdb6abfb
commit
371a5c48f5
@ -49,7 +49,7 @@
|
|||||||
* 20 Apr 93 Bruce Evans New npx-0.5 code
|
* 20 Apr 93 Bruce Evans New npx-0.5 code
|
||||||
* 25 Apr 93 Bruce Evans New intr-0.1 code
|
* 25 Apr 93 Bruce Evans New intr-0.1 code
|
||||||
*/
|
*/
|
||||||
static char rcsid[] = "$Header: /usr/src/sys.386bsd/i386/i386/RCS/machdep.c,v 1.2 92/01/21 14:22:09 william Exp Locker: root $";
|
static char rcsid[] = "$Header: /home/cvs/386BSD/src/sys.386bsd/i386/i386/machdep.c,v 1.1.1.1 93/06/12 14:58:06 rgrimes Exp $";
|
||||||
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -85,6 +85,10 @@ extern vm_offset_t avail_end;
|
|||||||
#define EXPECT_BASEMEM 640 /* The expected base memory*/
|
#define EXPECT_BASEMEM 640 /* The expected base memory*/
|
||||||
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
|
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
|
||||||
|
|
||||||
|
#if __GNUC__ >= 2
|
||||||
|
__main(){}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declare these as initialized data so we can patch them.
|
* Declare these as initialized data so we can patch them.
|
||||||
*/
|
*/
|
||||||
@ -653,6 +657,7 @@ setregs(p, entry)
|
|||||||
/*
|
/*
|
||||||
* Initialize segments & interrupt table
|
* Initialize segments & interrupt table
|
||||||
*/
|
*/
|
||||||
|
#define DESCRIPTOR_SIZE 8
|
||||||
|
|
||||||
|
|
||||||
#define GNULL_SEL 0 /* Null Descriptor */
|
#define GNULL_SEL 0 /* Null Descriptor */
|
||||||
@ -664,13 +669,13 @@ setregs(p, entry)
|
|||||||
#define GPROC0_SEL 6 /* Task state process slot zero and up */
|
#define GPROC0_SEL 6 /* Task state process slot zero and up */
|
||||||
#define NGDT GPROC0_SEL+1
|
#define NGDT GPROC0_SEL+1
|
||||||
|
|
||||||
union descriptor gdt[GPROC0_SEL+1];
|
unsigned char gdt[GPROC0_SEL+1][DESCRIPTOR_SIZE];
|
||||||
|
|
||||||
/* interrupt descriptor table */
|
/* interrupt descriptor table */
|
||||||
struct gate_descriptor idt[NIDT];
|
struct gate_descriptor idt[NIDT];
|
||||||
|
|
||||||
/* local descriptor table */
|
/* local descriptor table */
|
||||||
union descriptor ldt[5];
|
unsigned char ldt[5][DESCRIPTOR_SIZE];
|
||||||
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
|
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
|
||||||
#define LSYS5SIGR_SEL 1
|
#define LSYS5SIGR_SEL 1
|
||||||
|
|
||||||
@ -831,7 +836,7 @@ init386(first)
|
|||||||
struct gate_descriptor *gdp;
|
struct gate_descriptor *gdp;
|
||||||
extern int sigcode,szsigcode;
|
extern int sigcode,szsigcode;
|
||||||
/* table descriptors - used to load tables by microp */
|
/* table descriptors - used to load tables by microp */
|
||||||
struct region_descriptor r_gdt, r_idt;
|
unsigned short r_gdt[3], r_idt[3];
|
||||||
int pagesinbase, pagesinext;
|
int pagesinbase, pagesinext;
|
||||||
|
|
||||||
|
|
||||||
@ -845,12 +850,12 @@ init386(first)
|
|||||||
|
|
||||||
/* make gdt memory segments */
|
/* make gdt memory segments */
|
||||||
gdt_segs[GCODE_SEL].ssd_limit = btoc((int) &etext + NBPG);
|
gdt_segs[GCODE_SEL].ssd_limit = btoc((int) &etext + NBPG);
|
||||||
for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, gdt+x);
|
for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, &gdt[x][0]);
|
||||||
/* make ldt memory segments */
|
/* make ldt memory segments */
|
||||||
ldt_segs[LUCODE_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
ldt_segs[LUCODE_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
||||||
ldt_segs[LUDATA_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
ldt_segs[LUDATA_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
||||||
/* Note. eventually want private ldts per process */
|
/* Note. eventually want private ldts per process */
|
||||||
for (x=0; x < 5; x++) ssdtosd(ldt_segs+x, ldt+x);
|
for (x=0; x < 5; x++) ssdtosd(ldt_segs+x, &ldt[x][0]);
|
||||||
|
|
||||||
/* exceptions */
|
/* exceptions */
|
||||||
setidt(0, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL);
|
setidt(0, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL);
|
||||||
@ -891,11 +896,13 @@ init386(first)
|
|||||||
isa_defaultirq();
|
isa_defaultirq();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
r_gdt.rd_limit = sizeof(gdt)-1;
|
r_gdt[0] = (unsigned short) (sizeof(gdt) - 1);
|
||||||
r_gdt.rd_base = (int) gdt;
|
r_gdt[1] = (unsigned short) ((int) gdt & 0xffff);
|
||||||
|
r_gdt[2] = (unsigned short) ((int) gdt >> 16);
|
||||||
lgdt(&r_gdt);
|
lgdt(&r_gdt);
|
||||||
r_idt.rd_limit = sizeof(idt)-1;
|
r_idt[0] = (unsigned short) (sizeof(idt) - 1);
|
||||||
r_idt.rd_base = (int) idt;
|
r_idt[1] = (unsigned short) ((int) idt & 0xfffff);
|
||||||
|
r_idt[2] = (unsigned short) ((int) idt >> 16);
|
||||||
lidt(&r_idt);
|
lidt(&r_idt);
|
||||||
lldt(GSEL(GLDT_SEL, SEL_KPL));
|
lldt(GSEL(GLDT_SEL, SEL_KPL));
|
||||||
|
|
||||||
@ -975,7 +982,7 @@ init386(first)
|
|||||||
ltr(_gsel_tss);
|
ltr(_gsel_tss);
|
||||||
|
|
||||||
/* make a call gate to reenter kernel with */
|
/* make a call gate to reenter kernel with */
|
||||||
gdp = &ldt[LSYS5CALLS_SEL].gd;
|
gdp = (struct gate_descriptor *) &ldt[LSYS5CALLS_SEL][0];
|
||||||
|
|
||||||
x = (int) &IDTVEC(syscall);
|
x = (int) &IDTVEC(syscall);
|
||||||
gdp->gd_looffset = x++;
|
gdp->gd_looffset = x++;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
* 20 Apr 93 Bruce Evans New npx-0.5 code
|
* 20 Apr 93 Bruce Evans New npx-0.5 code
|
||||||
* 25 Apr 93 Bruce Evans New intr-0.1 code
|
* 25 Apr 93 Bruce Evans New intr-0.1 code
|
||||||
*/
|
*/
|
||||||
static char rcsid[] = "$Header: /usr/src/sys.386bsd/i386/i386/RCS/machdep.c,v 1.2 92/01/21 14:22:09 william Exp Locker: root $";
|
static char rcsid[] = "$Header: /home/cvs/386BSD/src/sys.386bsd/i386/i386/machdep.c,v 1.1.1.1 93/06/12 14:58:06 rgrimes Exp $";
|
||||||
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -85,6 +85,10 @@ extern vm_offset_t avail_end;
|
|||||||
#define EXPECT_BASEMEM 640 /* The expected base memory*/
|
#define EXPECT_BASEMEM 640 /* The expected base memory*/
|
||||||
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
|
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
|
||||||
|
|
||||||
|
#if __GNUC__ >= 2
|
||||||
|
__main(){}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declare these as initialized data so we can patch them.
|
* Declare these as initialized data so we can patch them.
|
||||||
*/
|
*/
|
||||||
@ -653,6 +657,7 @@ setregs(p, entry)
|
|||||||
/*
|
/*
|
||||||
* Initialize segments & interrupt table
|
* Initialize segments & interrupt table
|
||||||
*/
|
*/
|
||||||
|
#define DESCRIPTOR_SIZE 8
|
||||||
|
|
||||||
|
|
||||||
#define GNULL_SEL 0 /* Null Descriptor */
|
#define GNULL_SEL 0 /* Null Descriptor */
|
||||||
@ -664,13 +669,13 @@ setregs(p, entry)
|
|||||||
#define GPROC0_SEL 6 /* Task state process slot zero and up */
|
#define GPROC0_SEL 6 /* Task state process slot zero and up */
|
||||||
#define NGDT GPROC0_SEL+1
|
#define NGDT GPROC0_SEL+1
|
||||||
|
|
||||||
union descriptor gdt[GPROC0_SEL+1];
|
unsigned char gdt[GPROC0_SEL+1][DESCRIPTOR_SIZE];
|
||||||
|
|
||||||
/* interrupt descriptor table */
|
/* interrupt descriptor table */
|
||||||
struct gate_descriptor idt[NIDT];
|
struct gate_descriptor idt[NIDT];
|
||||||
|
|
||||||
/* local descriptor table */
|
/* local descriptor table */
|
||||||
union descriptor ldt[5];
|
unsigned char ldt[5][DESCRIPTOR_SIZE];
|
||||||
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
|
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
|
||||||
#define LSYS5SIGR_SEL 1
|
#define LSYS5SIGR_SEL 1
|
||||||
|
|
||||||
@ -831,7 +836,7 @@ init386(first)
|
|||||||
struct gate_descriptor *gdp;
|
struct gate_descriptor *gdp;
|
||||||
extern int sigcode,szsigcode;
|
extern int sigcode,szsigcode;
|
||||||
/* table descriptors - used to load tables by microp */
|
/* table descriptors - used to load tables by microp */
|
||||||
struct region_descriptor r_gdt, r_idt;
|
unsigned short r_gdt[3], r_idt[3];
|
||||||
int pagesinbase, pagesinext;
|
int pagesinbase, pagesinext;
|
||||||
|
|
||||||
|
|
||||||
@ -845,12 +850,12 @@ init386(first)
|
|||||||
|
|
||||||
/* make gdt memory segments */
|
/* make gdt memory segments */
|
||||||
gdt_segs[GCODE_SEL].ssd_limit = btoc((int) &etext + NBPG);
|
gdt_segs[GCODE_SEL].ssd_limit = btoc((int) &etext + NBPG);
|
||||||
for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, gdt+x);
|
for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, &gdt[x][0]);
|
||||||
/* make ldt memory segments */
|
/* make ldt memory segments */
|
||||||
ldt_segs[LUCODE_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
ldt_segs[LUCODE_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
||||||
ldt_segs[LUDATA_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
ldt_segs[LUDATA_SEL].ssd_limit = btoc(UPT_MIN_ADDRESS);
|
||||||
/* Note. eventually want private ldts per process */
|
/* Note. eventually want private ldts per process */
|
||||||
for (x=0; x < 5; x++) ssdtosd(ldt_segs+x, ldt+x);
|
for (x=0; x < 5; x++) ssdtosd(ldt_segs+x, &ldt[x][0]);
|
||||||
|
|
||||||
/* exceptions */
|
/* exceptions */
|
||||||
setidt(0, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL);
|
setidt(0, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL);
|
||||||
@ -891,11 +896,13 @@ init386(first)
|
|||||||
isa_defaultirq();
|
isa_defaultirq();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
r_gdt.rd_limit = sizeof(gdt)-1;
|
r_gdt[0] = (unsigned short) (sizeof(gdt) - 1);
|
||||||
r_gdt.rd_base = (int) gdt;
|
r_gdt[1] = (unsigned short) ((int) gdt & 0xffff);
|
||||||
|
r_gdt[2] = (unsigned short) ((int) gdt >> 16);
|
||||||
lgdt(&r_gdt);
|
lgdt(&r_gdt);
|
||||||
r_idt.rd_limit = sizeof(idt)-1;
|
r_idt[0] = (unsigned short) (sizeof(idt) - 1);
|
||||||
r_idt.rd_base = (int) idt;
|
r_idt[1] = (unsigned short) ((int) idt & 0xfffff);
|
||||||
|
r_idt[2] = (unsigned short) ((int) idt >> 16);
|
||||||
lidt(&r_idt);
|
lidt(&r_idt);
|
||||||
lldt(GSEL(GLDT_SEL, SEL_KPL));
|
lldt(GSEL(GLDT_SEL, SEL_KPL));
|
||||||
|
|
||||||
@ -975,7 +982,7 @@ init386(first)
|
|||||||
ltr(_gsel_tss);
|
ltr(_gsel_tss);
|
||||||
|
|
||||||
/* make a call gate to reenter kernel with */
|
/* make a call gate to reenter kernel with */
|
||||||
gdp = &ldt[LSYS5CALLS_SEL].gd;
|
gdp = (struct gate_descriptor *) &ldt[LSYS5CALLS_SEL][0];
|
||||||
|
|
||||||
x = (int) &IDTVEC(syscall);
|
x = (int) &IDTVEC(syscall);
|
||||||
gdp->gd_looffset = x++;
|
gdp->gd_looffset = x++;
|
||||||
|
@ -625,7 +625,7 @@ char * ea(struct trapframe * info, unsigned short code)
|
|||||||
I387.fos = 0x17;
|
I387.fos = 0x17;
|
||||||
return (char *) offset;
|
return (char *) offset;
|
||||||
}
|
}
|
||||||
tmp = & (long)REG(rm);
|
tmp = (long *) ®(rm);
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
case 0: offset = 0; break;
|
case 0: offset = 0; break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
_cpl: .long 0xffff # current priority (all off)
|
_cpl: .long 0xffff # current priority (all off)
|
||||||
.globl _imen
|
.globl _imen
|
||||||
_imen: .long 0xffff # interrupt mask enable (all off)
|
_imen: .long 0xffff # interrupt mask enable (all off)
|
||||||
# .globl _highmask
|
/* .globl _highmask */
|
||||||
_highmask: .long HIGHMASK
|
_highmask: .long HIGHMASK
|
||||||
.globl _ttymask
|
.globl _ttymask
|
||||||
_ttymask: .long 0
|
_ttymask: .long 0
|
||||||
|
@ -154,12 +154,12 @@ struct isa_driver wddriver = {
|
|||||||
wdprobe, wdattach, "wd",
|
wdprobe, wdattach, "wd",
|
||||||
};
|
};
|
||||||
|
|
||||||
void wdustart(struct disk *);
|
static void wdustart(struct disk *);
|
||||||
void wdstart();
|
static void wdstart();
|
||||||
int wdcommand(struct disk *, int);
|
static int wdcommand(struct disk *, int);
|
||||||
int wdcontrol(struct buf *);
|
static int wdcontrol(struct buf *);
|
||||||
int wdsetctlr(dev_t, struct disk *);
|
static int wdsetctlr(dev_t, struct disk *);
|
||||||
int wdgetctlr(int, struct disk *);
|
static int wdgetctlr(int, struct disk *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Probe for controller.
|
* Probe for controller.
|
||||||
@ -423,7 +423,14 @@ wdstart()
|
|||||||
*/
|
*/
|
||||||
if ((du->dk_flags & (DKFL_SINGLE|DKFL_BADSECT)) /* 19 Aug 92*/
|
if ((du->dk_flags & (DKFL_SINGLE|DKFL_BADSECT)) /* 19 Aug 92*/
|
||||||
== (DKFL_SINGLE|DKFL_BADSECT))
|
== (DKFL_SINGLE|DKFL_BADSECT))
|
||||||
for (bt_ptr = du->dk_bad.bt_bad; bt_ptr->bt_cyl != -1; bt_ptr++) {
|
/* XXX
|
||||||
|
* BAD144END was done to clean up some old bad code that was
|
||||||
|
* attempting to compare a u_short to -1. This makes the compilers
|
||||||
|
* happy and clearly shows what is going on.
|
||||||
|
* rgrimes 93/06/17
|
||||||
|
*/
|
||||||
|
#define BAD144END (u_short)(-1)
|
||||||
|
for (bt_ptr = du->dk_bad.bt_bad; bt_ptr->bt_cyl != BAD144END; bt_ptr++) {
|
||||||
if (bt_ptr->bt_cyl > cylin)
|
if (bt_ptr->bt_cyl > cylin)
|
||||||
/* Sorted list, and we passed our cylinder. quit. */
|
/* Sorted list, and we passed our cylinder. quit. */
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user