summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/i386/isa
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/apic_vector.s26
-rw-r--r--sys/i386/isa/asc.c10
-rw-r--r--sys/i386/isa/atpic_vector.s12
-rw-r--r--sys/i386/isa/ctx.c6
-rw-r--r--sys/i386/isa/cx.c10
-rw-r--r--sys/i386/isa/cy.c20
-rw-r--r--sys/i386/isa/gpib.c10
-rw-r--r--sys/i386/isa/gsc.c6
-rw-r--r--sys/i386/isa/icu_vector.s12
-rw-r--r--sys/i386/isa/ipl.s5
-rw-r--r--sys/i386/isa/istallion.c26
-rw-r--r--sys/i386/isa/loran.c4
-rw-r--r--sys/i386/isa/matcd/matcd.c8
-rw-r--r--sys/i386/isa/mcd.c6
-rw-r--r--sys/i386/isa/mse.c18
-rw-r--r--sys/i386/isa/npx.c85
-rw-r--r--sys/i386/isa/pcaudio.c10
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c12
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c9
-rw-r--r--sys/i386/isa/pcvt/pcvt_hdr.h2
-rw-r--r--sys/i386/isa/rc.c18
-rw-r--r--sys/i386/isa/scd.c6
-rw-r--r--sys/i386/isa/spic.c10
-rw-r--r--sys/i386/isa/spigot.c16
-rw-r--r--sys/i386/isa/spkr.c12
-rw-r--r--sys/i386/isa/stallion.c26
-rw-r--r--sys/i386/isa/tw.c14
-rw-r--r--sys/i386/isa/vesa.c3
-rw-r--r--sys/i386/isa/wt.c6
29 files changed, 207 insertions, 201 deletions
diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s
index 5c68f81..8096d3c 100644
--- a/sys/i386/isa/apic_vector.s
+++ b/sys/i386/isa/apic_vector.s
@@ -48,10 +48,10 @@ IDTVEC(vec_name) ; \
movl $KPSEL,%eax ; \
mov %ax,%fs ; \
FAKE_MCOUNT(13*4(%esp)) ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
pushl intr_unit + (irq_num) * 4 ; \
- call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \
+ call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \
addl $4, %esp ; \
movl $0, lapic+LA_EOI ; \
lock ; \
@@ -59,7 +59,7 @@ IDTVEC(vec_name) ; \
movl intr_countp + (irq_num) * 4, %eax ; \
lock ; \
incl (%eax) ; \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
jmp doreti
@@ -152,8 +152,8 @@ IDTVEC(vec_name) ; \
MASK_LEVEL_IRQ(irq_num) ; \
EOI_IRQ(irq_num) ; \
0: ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
; \
/* entry point used by doreti_unpend for HWIs. */ \
__CONCAT(Xresume,irq_num): ; \
@@ -162,7 +162,7 @@ __CONCAT(Xresume,irq_num): ; \
call sched_ithd ; \
addl $4, %esp ; /* discard the parameter */ \
; \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
jmp doreti
@@ -227,10 +227,10 @@ Xhardclock:
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
- movl PCPU(CURPROC),%ebx
- incl P_INTR_NESTING_LEVEL(%ebx)
+ movl PCPU(CURTHREAD),%ebx
+ incl TD_INTR_NESTING_LEVEL(%ebx)
call forwarded_hardclock
- decl P_INTR_NESTING_LEVEL(%ebx)
+ decl TD_INTR_NESTING_LEVEL(%ebx)
MEXITCOUNT
jmp doreti
@@ -252,10 +252,10 @@ Xstatclock:
movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */
FAKE_MCOUNT(13*4(%esp))
- movl PCPU(CURPROC),%ebx
- incl P_INTR_NESTING_LEVEL(%ebx)
+ movl PCPU(CURTHREAD),%ebx
+ incl TD_INTR_NESTING_LEVEL(%ebx)
call forwarded_statclock
- decl P_INTR_NESTING_LEVEL(%ebx)
+ decl TD_INTR_NESTING_LEVEL(%ebx)
MEXITCOUNT
jmp doreti
diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c
index 2cc081e..9042fbc 100644
--- a/sys/i386/isa/asc.c
+++ b/sys/i386/isa/asc.c
@@ -552,7 +552,7 @@ ascintr(int unit)
***/
STATIC int
-ascopen(dev_t dev, int flags, int fmt, struct proc *p)
+ascopen(dev_t dev, int flags, int fmt, struct thread *td)
{
struct asc_unit *scu;
int unit;
@@ -647,7 +647,7 @@ asc_startread(struct asc_unit *scu)
***/
STATIC int
-ascclose(dev_t dev, int flags, int fmt, struct proc *p)
+ascclose(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit = UNIT(minor(dev));
struct asc_unit *scu = unittab + unit;
@@ -794,7 +794,7 @@ ascread(dev_t dev, struct uio *uio, int ioflag)
***/
STATIC int
-ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
+ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int unit = UNIT(minor(dev));
struct asc_unit *scu = unittab + unit;
@@ -859,7 +859,7 @@ ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
}
STATIC int
-ascpoll(dev_t dev, int events, struct proc *p)
+ascpoll(dev_t dev, int events, struct thread *td)
{
int unit = UNIT(minor(dev));
struct asc_unit *scu = unittab + unit;
@@ -875,7 +875,7 @@ ascpoll(dev_t dev, int events, struct proc *p)
if (!(scu->flags & DMA_ACTIVE))
dma_restart(scu);
- selrecord(p, &scu->selp);
+ selrecord(td, &scu->selp);
}
}
splx(sps);
diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s
index 6b48737..3a42af4 100644
--- a/sys/i386/isa/atpic_vector.s
+++ b/sys/i386/isa/atpic_vector.s
@@ -61,8 +61,8 @@ IDTVEC(vec_name) ; \
mov $KPSEL,%ax ; \
mov %ax,%fs ; \
FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
pushl intr_unit + (irq_num) * 4 ; \
call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \
enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \
@@ -70,7 +70,7 @@ IDTVEC(vec_name) ; \
incl cnt+V_INTR ; /* book-keeping can wait */ \
movl intr_countp + (irq_num) * 4,%eax ; \
incl (%eax) ; \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
jmp doreti
@@ -104,14 +104,14 @@ IDTVEC(vec_name) ; \
movb %al,imen + IRQ_BYTE(irq_num) ; \
outb %al,$icu+ICU_IMR_OFFSET ; \
enable_icus ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
__CONCAT(Xresume,irq_num): ; \
FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \
pushl $irq_num; /* pass the IRQ */ \
call sched_ithd ; \
addl $4, %esp ; /* discard the parameter */ \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
/* doreti, but it's probably better to use less cache. */ \
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index 9a387fc..c755004 100644
--- a/sys/i386/isa/ctx.c
+++ b/sys/i386/isa/ctx.c
@@ -218,7 +218,7 @@ ctxattach(struct isa_device * devp)
}
static int
-ctxopen(dev_t dev, int flags, int fmt, struct proc *p)
+ctxopen(dev_t dev, int flags, int fmt, struct thread *td)
{
struct ctx_soft_registers *sr;
u_char unit;
@@ -273,7 +273,7 @@ ctxopen(dev_t dev, int flags, int fmt, struct proc *p)
}
static int
-ctxclose(dev_t dev, int flags, int fmt, struct proc *p)
+ctxclose(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit;
@@ -383,7 +383,7 @@ ctxread(dev_t dev, struct uio * uio, int ioflag)
}
static int
-ctxioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
+ctxioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int error;
int unit, i;
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 1c473e9..e9817d0 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -111,7 +111,7 @@ static void cxoproc (struct tty *tp);
static void cxstop (struct tty *tp, int flag);
static int cxparam (struct tty *tp, struct termios *t);
-int cxopen (dev_t dev, int flag, int mode, struct proc *p)
+int cxopen (dev_t dev, int flag, int mode, struct thread *td)
{
int unit = UNIT (dev);
cx_chan_t *c = cxchan[unit];
@@ -162,7 +162,7 @@ int cxopen (dev_t dev, int flag, int mode, struct proc *p)
tp = c->ttyp;
tp->t_dev = dev;
if ((tp->t_state & TS_ISOPEN) && (tp->t_state & TS_XCLUDE) &&
- suser(p))
+ suser_td(td))
return (EBUSY);
if (! (tp->t_state & TS_ISOPEN)) {
ttychars (tp);
@@ -247,7 +247,7 @@ int cxopen (dev_t dev, int flag, int mode, struct proc *p)
return (error);
}
-int cxclose (dev_t dev, int flag, int mode, struct proc *p)
+int cxclose (dev_t dev, int flag, int mode, struct thread *td)
{
int unit = UNIT (dev);
cx_chan_t *c = cxchan[unit];
@@ -283,7 +283,7 @@ int cxclose (dev_t dev, int flag, int mode, struct proc *p)
return (0);
}
-int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int unit = UNIT (dev);
cx_chan_t *c, *m;
@@ -419,7 +419,7 @@ int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (! tp)
return (EINVAL);
#if __FreeBSD__ >= 2
- error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag, p);
+ error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag, td);
#else
error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag);
#endif
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 9d6f2bb..728ea0a 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -662,11 +662,11 @@ cyattach_common(cy_iobase, cy_align)
}
static int
-sioopen(dev, flag, mode, p)
+sioopen(dev, flag, mode, td)
dev_t dev;
int flag;
int mode;
- struct proc *p;
+ struct thread *td;
{
struct com_s *com;
int error;
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p)) {
+ suser_td(td)) {
error = EBUSY;
goto out;
}
@@ -847,11 +847,11 @@ out:
}
static int
-sioclose(dev, flag, mode, p)
+sioclose(dev, flag, mode, td)
dev_t dev;
int flag;
int mode;
- struct proc *p;
+ struct thread *td;
{
struct com_s *com;
int mynor;
@@ -1605,12 +1605,12 @@ siointr1(com)
#endif
static int
-sioioctl(dev, cmd, data, flag, p)
+sioioctl(dev, cmd, data, flag, td)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
- struct proc *p;
+ struct thread *td;
{
struct com_s *com;
int error;
@@ -1639,7 +1639,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p);
+ error = suser_td(td);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1689,7 +1689,7 @@ sioioctl(dev, cmd, data, flag, p)
if (lt->c_ospeed != 0)
dt->c_ospeed = tp->t_ospeed;
}
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
if (error != ENOIOCTL)
return (error);
s = spltty();
@@ -1738,7 +1738,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p);
+ error = suser_td(td);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c
index 8792395..4b96605 100644
--- a/sys/i386/isa/gpib.c
+++ b/sys/i386/isa/gpib.c
@@ -163,11 +163,11 @@ gpattach(isdp)
* i.e. even if gpib5 is open, we can't open another minor device
*/
static int
-gpopen(dev, flags, fmt, p)
+gpopen(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
struct gpib_softc *sc = &gpib_sc;
u_char unit;
@@ -241,11 +241,11 @@ enableremote(unit);
* Close gpib device.
*/
static int
-gpclose(dev, flags, fmt, p)
+gpclose(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
struct gpib_softc *sc = &gpib_sc;
unsigned char unit;
@@ -397,7 +397,7 @@ gpwrite(dev, uio, ioflag)
write to using a minor device = its GPIB address */
static int
-gpioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
+gpioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
struct gpibdata *gd = (struct gpibdata *)data;
int error,result;
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 8d7ded3..29ad157 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -563,7 +563,7 @@ gscattach(struct isa_device *isdp)
*/
static int
-gscopen (dev_t dev, int flags, int fmt, struct proc *p)
+gscopen (dev_t dev, int flags, int fmt, struct thread *td)
{
struct gsc_unit *scu;
int unit;
@@ -630,7 +630,7 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
*/
static int
-gscclose (dev_t dev, int flags, int fmt, struct proc *p)
+gscclose (dev_t dev, int flags, int fmt, struct thread *td)
{
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
@@ -753,7 +753,7 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
*/
static int
-gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
diff --git a/sys/i386/isa/icu_vector.s b/sys/i386/isa/icu_vector.s
index 6b48737..3a42af4 100644
--- a/sys/i386/isa/icu_vector.s
+++ b/sys/i386/isa/icu_vector.s
@@ -61,8 +61,8 @@ IDTVEC(vec_name) ; \
mov $KPSEL,%ax ; \
mov %ax,%fs ; \
FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
pushl intr_unit + (irq_num) * 4 ; \
call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \
enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \
@@ -70,7 +70,7 @@ IDTVEC(vec_name) ; \
incl cnt+V_INTR ; /* book-keeping can wait */ \
movl intr_countp + (irq_num) * 4,%eax ; \
incl (%eax) ; \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
jmp doreti
@@ -104,14 +104,14 @@ IDTVEC(vec_name) ; \
movb %al,imen + IRQ_BYTE(irq_num) ; \
outb %al,$icu+ICU_IMR_OFFSET ; \
enable_icus ; \
- movl PCPU(CURPROC),%ebx ; \
- incl P_INTR_NESTING_LEVEL(%ebx) ; \
+ movl PCPU(CURTHREAD),%ebx ; \
+ incl TD_INTR_NESTING_LEVEL(%ebx) ; \
__CONCAT(Xresume,irq_num): ; \
FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \
pushl $irq_num; /* pass the IRQ */ \
call sched_ithd ; \
addl $4, %esp ; /* discard the parameter */ \
- decl P_INTR_NESTING_LEVEL(%ebx) ; \
+ decl TD_INTR_NESTING_LEVEL(%ebx) ; \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
/* doreti, but it's probably better to use less cache. */ \
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s
index d429f5a..c1b1d86 100644
--- a/sys/i386/isa/ipl.s
+++ b/sys/i386/isa/ipl.s
@@ -72,8 +72,9 @@ doreti_ast:
* since we will be informed of any new ASTs by an IPI.
*/
cli
- movl PCPU(CURPROC),%eax
- testl $PS_ASTPENDING | PS_NEEDRESCHED,P_SFLAG(%eax)
+ movl PCPU(CURTHREAD),%eax
+ movl TD_KSE(%eax), %eax
+ testl $KEF_ASTPENDING | KEF_NEEDRESCHED,KE_FLAGS(%eax)
je doreti_exit
sti
pushl %esp /* pass a pointer to the trapframe */
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index b8ba4db..0b95211 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -573,7 +573,7 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp,
struct termios *tiosp);
static int stli_memrw(dev_t dev, struct uio *uiop, int flag);
static int stli_memioctl(dev_t dev, unsigned long cmd, caddr_t data,
- int flag, struct proc *p);
+ int flag, struct thread *td);
static int stli_getbrdstats(caddr_t data);
static int stli_getportstats(stliport_t *portp, caddr_t data);
static int stli_clrportstats(stliport_t *portp, caddr_t data);
@@ -925,7 +925,7 @@ static int stliattach(struct isa_device *idp)
/*****************************************************************************/
-STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p)
+STATIC int stliopen(dev_t dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
stliport_t *portp;
@@ -933,7 +933,7 @@ STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p)
#if DEBUG
printf("stliopen(dev=%x,flag=%x,mode=%x,p=%x)\n", (int) dev, flag,
- mode, (int) p);
+ mode, (int) td);
#endif
/*
@@ -1010,7 +1010,7 @@ stliopen_restart:
}
}
if ((tp->t_state & TS_XCLUDE) &&
- suser(p)) {
+ suser_td(td)) {
error = EBUSY;
goto stliopen_end;
}
@@ -1054,7 +1054,7 @@ stliopen_end:
/*****************************************************************************/
-STATIC int stliclose(dev_t dev, int flag, int mode, struct proc *p)
+STATIC int stliclose(dev_t dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
stliport_t *portp;
@@ -1062,7 +1062,7 @@ STATIC int stliclose(dev_t dev, int flag, int mode, struct proc *p)
#if DEBUG
printf("stliclose(dev=%s,flag=%x,mode=%x,p=%p)\n",
- devtoname(dev), flag, mode, (void *) p);
+ devtoname(dev), flag, mode, (void *) td);
#endif
if (minor(dev) & STL_MEMDEV)
@@ -1142,7 +1142,7 @@ STATIC int stliwrite(dev_t dev, struct uio *uiop, int flag)
/*****************************************************************************/
STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
- struct proc *p)
+ struct thread *td)
{
struct termios *newtios, *localtios;
struct tty *tp;
@@ -1153,11 +1153,11 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
#if DEBUG
printf("stliioctl(dev=%s,cmd=%lx,data=%p,flag=%x,p=%p)\n",
- devtoname(dev), cmd, (void *) data, flag, (void *) p);
+ devtoname(dev), cmd, (void *) data, flag, (void *) td);
#endif
if (minor(dev) & STL_MEMDEV)
- return(stli_memioctl(dev, cmd, data, flag, p));
+ return(stli_memioctl(dev, cmd, data, flag, td));
portp = stli_dev2port(dev);
if (portp == (stliport_t *) NULL)
@@ -1182,7 +1182,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
switch (cmd) {
case TIOCSETA:
- if ((error = suser(p)) == 0)
+ if ((error = suser_td(td)) == 0)
*localtios = *((struct termios *) data);
break;
case TIOCGETA:
@@ -1249,7 +1249,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
* Call the line discipline and the common command processing to
* process this command (if they can).
*/
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
if (error != ENOIOCTL)
return(error);
@@ -1318,7 +1318,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
*((int *) data) = (portp->sigs | TIOCM_LE);
break;
case TIOCMSDTRWAIT:
- if ((error = suser(p)) == 0)
+ if ((error = suser_td(td)) == 0)
portp->dtrwait = *((int *) data) * hz / 100;
break;
case TIOCMGDTRWAIT:
@@ -3799,7 +3799,7 @@ STATIC int stli_memrw(dev_t dev, struct uio *uiop, int flag)
*/
static int stli_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
- struct proc *p)
+ struct thread *td)
{
stlibrd_t *brdp;
int brdnr, rc;
diff --git a/sys/i386/isa/loran.c b/sys/i386/isa/loran.c
index cedcd0f..9ad1a4a 100644
--- a/sys/i386/isa/loran.c
+++ b/sys/i386/isa/loran.c
@@ -328,7 +328,7 @@ loranattach(struct isa_device *isdp)
}
static int
-loranopen (dev_t dev, int flags, int fmt, struct proc *p)
+loranopen (dev_t dev, int flags, int fmt, struct thread *td)
{
int idx;
@@ -340,7 +340,7 @@ loranopen (dev_t dev, int flags, int fmt, struct proc *p)
}
static int
-loranclose(dev_t dev, int flags, int fmt, struct proc *p)
+loranclose(dev_t dev, int flags, int fmt, struct thread *td)
{
return(0);
}
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 7c3e758..0ec1c2e 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -608,7 +608,7 @@ static int docmd(char * cmd, int ldrive, int cdrive,
<15> the drive to be locked while being accessed.
---------------------------------------------------------------------------*/
int matcdopen(dev_t dev, int flags, int fmt,
- struct proc *p)
+ struct thread *td)
{
int cdrive,ldrive,partition,controller,lock;
struct matcd_data *cd;
@@ -797,7 +797,7 @@ int matcdopen(dev_t dev, int flags, int fmt,
---------------------------------------------------------------------------*/
int matcdclose(dev_t dev, int flags, int fmt,
- struct proc *p)
+ struct thread *td)
{
int ldrive,cdrive,port,partition,controller,lock;
struct matcd_data *cd;
@@ -985,7 +985,7 @@ static void matcd_start(int controller)
---------------------------------------------------------------------------*/
int matcdioctl(dev_t dev, u_long command, caddr_t addr,
- int flags, struct proc *p)
+ int flags, struct thread *td)
{
struct matcd_data *cd;
int ldrive,cdrive,partition;
@@ -2062,7 +2062,7 @@ nextblock:
int docmd(char * cmd, int ldrive, int cdrive, int controller, int port)
{
- int retries,i,z;
+ int retries,i=0,z;
lockbus(controller, ldrive); /*Request bus*/
retries=3;
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index 6f8c0f7..f295a43 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -270,7 +270,7 @@ int mcd_attach(struct isa_device *dev)
return 1;
}
-int mcdopen(dev_t dev, int flags, int fmt, struct proc *p)
+int mcdopen(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit,part,phys,r,retry;
struct mcd_data *cd;
@@ -362,7 +362,7 @@ MCD_TRACE("open: partition=%d, disksize = %ld, blksize=%d\n",
return ENXIO;
}
-int mcdclose(dev_t dev, int flags, int fmt, struct proc *p)
+int mcdclose(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit,part;
struct mcd_data *cd;
@@ -504,7 +504,7 @@ static void mcd_start(int unit)
return;
}
-int mcdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
+int mcdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct mcd_data *cd;
int unit,part,retry,r;
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index 073ea7a..915bc3f 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/mse.c
@@ -394,11 +394,11 @@ mse_detach(dev)
* Exclusive open the mouse, initialize it and enable interrupts.
*/
static int
-mseopen(dev, flags, fmt, p)
+mseopen(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
mse_softc_t *sc;
int s;
@@ -434,11 +434,11 @@ mseopen(dev, flags, fmt, p)
* mseclose: just turn off mouse innterrupts.
*/
static int
-mseclose(dev, flags, fmt, p)
+mseclose(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
int s;
@@ -525,12 +525,12 @@ mseread(dev, uio, ioflag)
* mseioctl: process ioctl commands.
*/
static int
-mseioctl(dev, cmd, addr, flag, p)
+mseioctl(dev, cmd, addr, flag, td)
dev_t dev;
u_long cmd;
caddr_t addr;
int flag;
- struct proc *p;
+ struct thread *td;
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
mousestatus_t status;
@@ -642,10 +642,10 @@ mseioctl(dev, cmd, addr, flag, p)
* msepoll: check for mouse input to be processed.
*/
static int
-msepoll(dev, events, p)
+msepoll(dev, events, td)
dev_t dev;
int events;
- struct proc *p;
+ struct thread *td;
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
int s;
@@ -662,7 +662,7 @@ msepoll(dev, events, p)
* Since this is an exclusive open device, any previous
* proc pointer is trash now, so we can just assign it.
*/
- selrecord(p, &sc->sc_selp);
+ selrecord(td, &sc->sc_selp);
}
}
splx(s);
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 4fe3d04..84534ea 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -128,23 +128,23 @@ void stop_emulating __P((void));
#endif /* __GNUC__ */
#ifdef CPU_ENABLE_SSE
-#define GET_FPU_CW(proc) \
+#define GET_FPU_CW(thread) \
(cpu_fxsr ? \
- (proc)->p_addr->u_pcb.pcb_save.sv_xmm.sv_env.en_cw : \
- (proc)->p_addr->u_pcb.pcb_save.sv_87.sv_env.en_cw)
-#define GET_FPU_SW(proc) \
+ (thread)->td_pcb->pcb_save.sv_xmm.sv_env.en_cw : \
+ (thread)->td_pcb->pcb_save.sv_87.sv_env.en_cw)
+#define GET_FPU_SW(thread) \
(cpu_fxsr ? \
- (proc)->p_addr->u_pcb.pcb_save.sv_xmm.sv_env.en_sw : \
- (proc)->p_addr->u_pcb.pcb_save.sv_87.sv_env.en_sw)
+ (thread)->td_pcb->pcb_save.sv_xmm.sv_env.en_sw : \
+ (thread)->td_pcb->pcb_save.sv_87.sv_env.en_sw)
#define GET_FPU_EXSW_PTR(pcb) \
(cpu_fxsr ? \
&(pcb)->pcb_save.sv_xmm.sv_ex_sw : \
&(pcb)->pcb_save.sv_87.sv_ex_sw)
#else /* CPU_ENABLE_SSE */
-#define GET_FPU_CW(proc) \
- (proc->p_addr->u_pcb.pcb_save.sv_87.sv_env.en_cw)
-#define GET_FPU_SW(proc) \
- (proc->p_addr->u_pcb.pcb_save.sv_87.sv_env.en_sw)
+#define GET_FPU_CW(thread) \
+ (thread->td_pcb->pcb_save.sv_87.sv_env.en_cw)
+#define GET_FPU_SW(thread) \
+ (thread->td_pcb->pcb_save.sv_87.sv_env.en_sw)
#define GET_FPU_EXSW_PTR(pcb) \
(&(pcb)->pcb_save.sv_87.sv_ex_sw)
#endif /* CPU_ENABLE_SSE */
@@ -241,7 +241,7 @@ static void
npx_intr(dummy)
void *dummy;
{
- struct proc *p;
+ struct thread *td;
/*
* The BUSY# latch must be cleared in all cases so that the next
@@ -250,22 +250,22 @@ npx_intr(dummy)
outb(0xf0, 0);
/*
- * npxproc is normally non-null here. In that case, schedule an
+ * npxthread is normally non-null here. In that case, schedule an
* AST to finish the exception handling in the correct context
- * (this interrupt may occur after the process has entered the
+ * (this interrupt may occur after the thread has entered the
* kernel via a syscall or an interrupt). Otherwise, the npx
- * state of the process that caused this interrupt must have been
- * pushed to the process' pcb, and clearing of the busy latch
+ * state of the thread that caused this interrupt must have been
+ * pushed to the thread' pcb, and clearing of the busy latch
* above has finished the (essentially null) handling of this
* interrupt. Control will eventually return to the instruction
* that caused it and it will repeat. We will eventually (usually
* soon) win the race to handle the interrupt properly.
*/
- p = PCPU_GET(npxproc);
- if (p != NULL) {
- p->p_addr->u_pcb.pcb_flags |= PCB_NPXTRAP;
+ td = PCPU_GET(npxthread);
+ if (td != NULL) {
+ td->td_pcb->pcb_flags |= PCB_NPXTRAP;
mtx_lock_spin(&sched_lock);
- p->p_sflag |= PS_ASTPENDING;
+ td->td_kse->ke_flags |= KEF_ASTPENDING;
mtx_unlock_spin(&sched_lock);
}
}
@@ -570,7 +570,7 @@ npxinit(control)
/*
* fninit has the same h/w bugs as fnsave. Use the detoxified
* fnsave to throw away any junk in the fpu. npxsave() initializes
- * the fpu and sets npxproc = NULL as important side effects.
+ * the fpu and sets npxthread = NULL as important side effects.
*/
savecrit = critical_enter();
npxsave(&dummy);
@@ -586,13 +586,13 @@ npxinit(control)
* Free coprocessor (if we have it).
*/
void
-npxexit(p)
- struct proc *p;
+npxexit(td)
+ struct thread *td;
{
critical_t savecrit;
savecrit = critical_enter();
- if (p == PCPU_GET(npxproc))
+ if (td == PCPU_GET(npxthread))
npxsave(&PCPU_GET(curpcb)->pcb_save);
critical_exit(savecrit);
#ifdef NPX_DEBUG
@@ -607,8 +607,9 @@ npxexit(p)
*/
if (masked_exceptions & 0x0d)
log(LOG_ERR,
- "pid %d (%s) exited with masked floating point exceptions 0x%02x\n",
- p->p_pid, p->p_comm, masked_exceptions);
+ "pid %d (%s) exited with masked floating"
+ " point exceptions 0x%02x\n",
+ td->td_proc->p_pid, td->td_proc->p_comm, masked_exceptions);
}
#endif
}
@@ -809,8 +810,8 @@ npxtrap()
u_long *exstat;
if (!npx_exists) {
- printf("npxtrap: npxproc = %p, curproc = %p, npx_exists = %d\n",
- PCPU_GET(npxproc), curproc, npx_exists);
+ printf("npxtrap: npxthread = %p, curthread = %p, npx_exists = %d\n",
+ PCPU_GET(npxthread), curthread, npx_exists);
panic("npxtrap from nowhere");
}
savecrit = critical_enter();
@@ -820,18 +821,18 @@ npxtrap()
* state to memory. Fetch the relevant parts of the state from
* wherever they are.
*/
- if (PCPU_GET(npxproc) != curproc) {
- control = GET_FPU_CW(curproc);
- status = GET_FPU_SW(curproc);
+ if (PCPU_GET(npxthread) != curthread) {
+ control = GET_FPU_CW(curthread);
+ status = GET_FPU_SW(curthread);
} else {
fnstcw(&control);
fnstsw(&status);
}
- exstat = GET_FPU_EXSW_PTR(&curproc->p_addr->u_pcb);
+ exstat = GET_FPU_EXSW_PTR(curthread->td_pcb);
*exstat = status;
- if (PCPU_GET(npxproc) != curproc)
- GET_FPU_SW(curproc) &= ~0x80bf;
+ if (PCPU_GET(npxthread) != curthread)
+ GET_FPU_SW(curthread) &= ~0x80bf;
else
fnclex();
critical_exit(savecrit);
@@ -841,7 +842,7 @@ npxtrap()
/*
* Implement device not available (DNA) exception
*
- * It would be better to switch FP context here (if curproc != npxproc)
+ * It would be better to switch FP context here (if curthread != npxthread)
* and not necessarily for every context switch, but it is too hard to
* access foreign pcb's.
*/
@@ -853,9 +854,9 @@ npxdna()
if (!npx_exists)
return (0);
- if (PCPU_GET(npxproc) != NULL) {
- printf("npxdna: npxproc = %p, curproc = %p\n",
- PCPU_GET(npxproc), curproc);
+ if (PCPU_GET(npxthread) != NULL) {
+ printf("npxdna: npxthread = %p, curthread = %p\n",
+ PCPU_GET(npxthread), curthread);
panic("npxdna");
}
s = critical_enter();
@@ -863,7 +864,7 @@ npxdna()
/*
* Record new context early in case frstor causes an IRQ13.
*/
- PCPU_SET(npxproc, CURPROC);
+ PCPU_SET(npxthread, curthread);
exstat = GET_FPU_EXSW_PTR(PCPU_GET(curpcb));
*exstat = 0;
@@ -895,13 +896,13 @@ npxdna()
* after the process has entered the kernel. It may even be delivered after
* the fnsave here completes. A spurious IRQ13 for the fnsave is handled in
* the same way as a very-late-arriving non-spurious IRQ13 from user mode:
- * it is normally ignored at first because we set npxproc to NULL; it is
+ * it is normally ignored at first because we set npxthread to NULL; it is
* normally retriggered in npxdna() after return to user mode.
*
* npxsave() must be called with interrupts disabled, so that it clears
- * npxproc atomically with saving the state. We require callers to do the
+ * npxthread atomically with saving the state. We require callers to do the
* disabling, since most callers need to disable interrupts anyway to call
- * npxsave() atomically with checking npxproc.
+ * npxsave() atomically with checking npxthread.
*
* A previous version of npxsave() went to great lengths to excecute fnsave
* with interrupts enabled in case executing it froze the CPU. This case
@@ -917,7 +918,7 @@ npxsave(addr)
fpusave(addr);
start_emulating();
- PCPU_SET(npxproc, NULL);
+ PCPU_SET(npxthread, NULL);
}
static void
diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index ebfce44..8002fcc 100644
--- a/sys/i386/isa/pcaudio.c
+++ b/sys/i386/isa/pcaudio.c
@@ -361,7 +361,7 @@ DRIVER_MODULE(pca, isa, pca_driver, pca_devclass, 0, 0);
static int
-pcaopen(dev_t dev, int flags, int fmt, struct proc *p)
+pcaopen(dev_t dev, int flags, int fmt, struct thread *td)
{
/* audioctl device can always be opened */
if (minor(dev) == 128)
@@ -389,7 +389,7 @@ pcaopen(dev_t dev, int flags, int fmt, struct proc *p)
static int
-pcaclose(dev_t dev, int flags, int fmt, struct proc *p)
+pcaclose(dev_t dev, int flags, int fmt, struct thread *td)
{
/* audioctl device can always be closed */
if (minor(dev) == 128)
@@ -460,7 +460,7 @@ pcawrite(dev_t dev, struct uio *uio, int flag)
static int
-pcaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+pcaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
audio_info_t *auptr;
@@ -560,7 +560,7 @@ pcaintr(struct clockframe *frame)
static int
-pcapoll(dev_t dev, int events, struct proc *p)
+pcapoll(dev_t dev, int events, struct thread *td)
{
int s;
int revents = 0;
@@ -572,7 +572,7 @@ pcapoll(dev_t dev, int events, struct proc *p)
!pca_status.in_use[2])
revents |= events & (POLLOUT | POLLWRNORM);
else
- selrecord(p, &pca_status.wsel);
+ selrecord(td, &pca_status.wsel);
}
splx(s);
return (revents);
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index 3c1cdea..3b0a64f 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -280,7 +280,7 @@ pcvt_attach(device_t dev)
* driver open
*---------------------------------------------------------------------------*/
static int
-pcvt_open(dev_t dev, int flag, int mode, struct proc *p)
+pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
{
register struct tty *tp;
register struct video_state *vsx;
@@ -316,7 +316,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct proc *p)
(*linesw[tp->t_line].l_modem)(tp, 1); /* fake connection */
winsz = 1; /* set winsize later */
}
- else if (tp->t_state & TS_XCLUDE && suser(p))
+ else if (tp->t_state & TS_XCLUDE && suser_td(td))
{
return (EBUSY);
}
@@ -348,7 +348,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct proc *p)
* driver close
*---------------------------------------------------------------------------*/
static int
-pcvt_close(dev_t dev, int flag, int mode, struct proc *p)
+pcvt_close(dev_t dev, int flag, int mode, struct thread *td)
{
register struct tty *tp;
register struct video_state *vsx;
@@ -378,7 +378,7 @@ pcvt_close(dev_t dev, int flag, int mode, struct proc *p)
* driver ioctl
*---------------------------------------------------------------------------*/
static int
-pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
register int error;
register struct tty *tp;
@@ -396,7 +396,7 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
*/
#ifdef XSERVER
- if((error = usl_vt_ioctl(dev, cmd, data, flag, p)) >= 0)
+ if((error = usl_vt_ioctl(dev, cmd, data, flag, td)) >= 0)
return error;
#endif /* XSERVER */
@@ -406,7 +406,7 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if((error = vgaioctl(dev,cmd,data,flag)) >= 0)
return error;
- if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p))
+ if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td))
!= ENOIOCTL)
return (error);
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index 967c928..7c9ed5f 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -2392,8 +2392,9 @@ vgapage(int new_screen)
* ioctl handling for VT_USL mode
*---------------------------------------------------------------------------*/
int
-usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
+usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td)
{
+ struct proc *p = td->td_proc;
int i, j, error, opri;
struct vt_mode newmode;
@@ -2613,9 +2614,9 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
/* grant the process IO access; only allowed if euid == 0 */
/* and insecure */
{
- struct trapframe *fp = p->p_frame;
+ struct trapframe *fp = td->td_frame;
- error = suser(p);
+ error = suser_td(td);
if (error != 0)
return (error);
if (securelevel > 0)
@@ -2629,7 +2630,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case KDDISABIO:
/* abandon IO access permission */
{
- struct trapframe *fp = p->p_frame;
+ struct trapframe *fp = td->td_frame;
fp->tf_eflags &= ~PSL_IOPL;
return 0;
}
diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h
index 4c9f540..46ea500 100644
--- a/sys/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/i386/isa/pcvt/pcvt_hdr.h
@@ -994,7 +994,7 @@ void update_hp ( struct video_state *svsp );
void update_led ( void );
#ifdef XSERVER
-int usl_vt_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *);
+int usl_vt_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct thread *);
#endif
void vga10_vga10 ( u_char *invga, u_char *outvga );
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index e4252e0..59e8dff 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -715,10 +715,10 @@ rc_stop(tp, rw)
}
static int
-rcopen(dev, flag, mode, p)
+rcopen(dev, flag, mode, td)
dev_t dev;
int flag, mode;
- struct proc *p;
+ struct thread *td;
{
register struct rc_chans *rc;
register struct tty *tp;
@@ -764,7 +764,7 @@ again:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p)) {
+ suser_td(td)) {
error = EBUSY;
goto out;
}
@@ -810,10 +810,10 @@ out:
}
static int
-rcclose(dev, flag, mode, p)
+rcclose(dev, flag, mode, td)
dev_t dev;
int flag, mode;
- struct proc *p;
+ struct thread *td;
{
register struct rc_chans *rc;
register struct tty *tp;
@@ -1064,18 +1064,18 @@ struct rc_softc *rcb;
}
static int
-rcioctl(dev, cmd, data, flag, p)
+rcioctl(dev, cmd, data, flag, td)
dev_t dev;
u_long cmd;
int flag;
caddr_t data;
-struct proc *p;
+struct thread *td;
{
register struct rc_chans *rc = &rc_chans[GET_UNIT(dev)];
register int s, error;
struct tty *tp = rc->rc_tp;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
if (error != ENOIOCTL)
return (error);
error = ttioctl(tp, cmd, data, flag);
@@ -1118,7 +1118,7 @@ struct proc *p;
break;
case TIOCMSDTRWAIT:
- error = suser(p);
+ error = suser_td(td);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index 1ab5afa..4561d90 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -232,7 +232,7 @@ scd_attach(struct isa_device *dev)
}
static int
-scdopen(dev_t dev, int flags, int fmt, struct proc *p)
+scdopen(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit,part,phys;
int rc;
@@ -286,7 +286,7 @@ scdopen(dev_t dev, int flags, int fmt, struct proc *p)
}
static int
-scdclose(dev_t dev, int flags, int fmt, struct proc *p)
+scdclose(dev_t dev, int flags, int fmt, struct thread *td)
{
int unit,part,phys;
struct scd_data *cd;
@@ -418,7 +418,7 @@ scd_start(int unit)
}
static int
-scdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
+scdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct scd_data *cd;
int unit,part;
diff --git a/sys/i386/isa/spic.c b/sys/i386/isa/spic.c
index 9593d73..a708658 100644
--- a/sys/i386/isa/spic.c
+++ b/sys/i386/isa/spic.c
@@ -362,7 +362,7 @@ spictimeout(void *arg)
}
static int
-spicopen(dev_t dev, int flag, int fmt, struct proc *p)
+spicopen(dev_t dev, int flag, int fmt, struct thread *td)
{
struct spic_softc *sc;
@@ -380,7 +380,7 @@ spicopen(dev_t dev, int flag, int fmt, struct proc *p)
}
static int
-spicclose(dev_t dev, int flag, int fmt, struct proc *p)
+spicclose(dev_t dev, int flag, int fmt, struct thread *td)
{
struct spic_softc *sc;
@@ -427,7 +427,7 @@ spicread(dev_t dev, struct uio *uio, int flag)
}
static int
-spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
+spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct spic_softc *sc;
@@ -437,7 +437,7 @@ spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
}
static int
-spicpoll(dev_t dev, int events, struct proc *p)
+spicpoll(dev_t dev, int events, struct thread *td)
{
struct spic_softc *sc;
int revents = 0, s;
@@ -448,7 +448,7 @@ spicpoll(dev_t dev, int events, struct proc *p)
if (sc->sc_count)
revents |= events & (POLLIN | POLLRDNORM);
else
- selrecord(p, &sc->sc_rsel); /* Who shall we wake? */
+ selrecord(td, &sc->sc_rsel); /* Who shall we wake? */
}
splx(s);
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index db4a926..0bd87ff 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -161,7 +161,7 @@ spigot_attach(struct isa_device *devp)
}
static int
-spigot_open(dev_t dev, int flags, int fmt, struct proc *p)
+spigot_open(dev_t dev, int flags, int fmt, struct thread *td)
{
int error;
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
@@ -179,7 +179,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
* require sufficient privilege soon and nothing much can be done
* without them.
*/
- error = suser(p);
+ error = suser_td(td);
if (error != 0)
return error;
if (securelevel > 0)
@@ -194,7 +194,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
}
static int
-spigot_close(dev_t dev, int flags, int fmt, struct proc *p)
+spigot_close(dev_t dev, int flags, int fmt, struct thread *td)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
@@ -221,7 +221,7 @@ spigot_read(dev_t dev, struct uio *uio, int ioflag)
static int
-spigot_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+spigot_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int error;
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
@@ -230,21 +230,21 @@ struct spigot_info *info;
if(!data) return(EINVAL);
switch(cmd){
case SPIGOT_SETINT:
- ss->p = p;
+ ss->p = td->td_proc;
ss->signal_num = *((int *)data);
break;
case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */
#if !defined(SPIGOT_UNSECURE)
- error = suser(p);
+ error = suser_td(td);
if (error != 0)
return error;
if (securelevel > 0)
return EPERM;
#endif
- p->p_frame->tf_eflags |= PSL_IOPL;
+ td->td_frame->tf_eflags |= PSL_IOPL;
break;
case SPIGOT_IOPL_OFF: /* deny access to the IO PAGE */
- p->p_frame->tf_eflags &= ~PSL_IOPL;
+ td->td_frame->tf_eflags &= ~PSL_IOPL;
break;
case SPIGOT_GET_INFO:
info = (struct spigot_info *)data;
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index 0fadea8..e0986de 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/spkr.c
@@ -460,11 +460,11 @@ static int spkr_active = FALSE; /* exclusion flag */
static char *spkr_inbuf; /* incoming buf */
int
-spkropen(dev, flags, fmt, p)
+spkropen(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
#ifdef DEBUG
(void) printf("spkropen: entering with dev = %s\n", devtoname(dev));
@@ -519,11 +519,11 @@ spkrwrite(dev, uio, ioflag)
}
int
-spkrclose(dev, flags, fmt, p)
+spkrclose(dev, flags, fmt, td)
dev_t dev;
int flags;
int fmt;
- struct proc *p;
+ struct thread *td;
{
#ifdef DEBUG
(void) printf("spkrclose: entering with dev = %s\n", devtoname(dev));
@@ -542,12 +542,12 @@ spkrclose(dev, flags, fmt, p)
}
int
-spkrioctl(dev, cmd, cmdarg, flags, p)
+spkrioctl(dev, cmd, cmdarg, flags, td)
dev_t dev;
unsigned long cmd;
caddr_t cmdarg;
int flags;
- struct proc *p;
+ struct thread *td;
{
#ifdef DEBUG
(void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n",
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index b77ec96..c9c0df5 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -484,7 +484,7 @@ static void stl_disableintrs(stlport_t *portp);
static void stl_sendbreak(stlport_t *portp, long len);
static void stl_flush(stlport_t *portp, int flag);
static int stl_memioctl(dev_t dev, unsigned long cmd, caddr_t data,
- int flag, struct proc *p);
+ int flag, struct thread *td);
static int stl_getbrdstats(caddr_t data);
static int stl_getportstats(stlport_t *portp, caddr_t data);
static int stl_clrportstats(stlport_t *portp, caddr_t data);
@@ -759,7 +759,7 @@ void stlpciattach(pcici_t tag, int unit)
/*****************************************************************************/
-STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p)
+STATIC int stlopen(dev_t dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
stlport_t *portp;
@@ -767,7 +767,7 @@ STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p)
#if DEBUG
printf("stlopen(dev=%x,flag=%x,mode=%x,p=%x)\n", (int) dev, flag,
- mode, (int) p);
+ mode, (int) td);
#endif
/*
@@ -832,7 +832,7 @@ stlopen_restart:
}
}
if ((tp->t_state & TS_XCLUDE) &&
- suser(p)) {
+ suser_td(td)) {
error = EBUSY;
goto stlopen_end;
}
@@ -876,7 +876,7 @@ stlopen_end:
/*****************************************************************************/
-STATIC int stlclose(dev_t dev, int flag, int mode, struct proc *p)
+STATIC int stlclose(dev_t dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
stlport_t *portp;
@@ -884,7 +884,7 @@ STATIC int stlclose(dev_t dev, int flag, int mode, struct proc *p)
#if DEBUG
printf("stlclose(dev=%s,flag=%x,mode=%x,p=%p)\n", devtoname(dev),
- flag, mode, (void *) p);
+ flag, mode, (void *) td);
#endif
if (minor(dev) & STL_MEMDEV)
@@ -934,7 +934,7 @@ STATIC int stlstop(struct tty *tp, int rw)
/*****************************************************************************/
STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
- struct proc *p)
+ struct thread *td)
{
struct termios *newtios, *localtios;
struct tty *tp;
@@ -943,11 +943,11 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
#if DEBUG
printf("stlioctl(dev=%s,cmd=%lx,data=%p,flag=%x,p=%p)\n",
- devtoname(dev), cmd, (void *) data, flag, (void *) p);
+ devtoname(dev), cmd, (void *) data, flag, (void *) td);
#endif
if (minor(dev) & STL_MEMDEV)
- return(stl_memioctl(dev, cmd, data, flag, p));
+ return(stl_memioctl(dev, cmd, data, flag, td));
portp = stl_dev2port(dev);
if (portp == (stlport_t *) NULL)
@@ -970,7 +970,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
switch (cmd) {
case TIOCSETA:
- if ((error = suser(p)) == 0)
+ if ((error = suser_td(td)) == 0)
*localtios = *((struct termios *) data);
break;
case TIOCGETA:
@@ -1037,7 +1037,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
* Call the line discipline and the common command processing to
* process this command (if they can).
*/
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
if (error != ENOIOCTL)
return(error);
@@ -1088,7 +1088,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
*((int *) data) = (stl_getsignals(portp) | TIOCM_LE);
break;
case TIOCMSDTRWAIT:
- if ((error = suser(p)) == 0)
+ if ((error = suser_td(td)) == 0)
portp->dtrwait = *((int *) data) * hz / 100;
break;
case TIOCMGDTRWAIT:
@@ -3048,7 +3048,7 @@ static int stl_clrportstats(stlport_t *portp, caddr_t data)
*/
static int stl_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
- struct proc *p)
+ struct thread *td)
{
stlbrd_t *brdp;
int brdnr, rc;
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index 4bb509d..5d68678 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -418,11 +418,11 @@ static int twattach(idp)
return (1);
}
-int twopen(dev, flag, mode, p)
+int twopen(dev, flag, mode, td)
dev_t dev;
int flag;
int mode;
- struct proc *p;
+ struct thread *td;
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
@@ -438,11 +438,11 @@ int twopen(dev, flag, mode, p)
return(0);
}
-int twclose(dev, flag, mode, p)
+int twclose(dev, flag, mode, td)
dev_t dev;
int flag;
int mode;
- struct proc *p;
+ struct thread *td;
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
@@ -544,10 +544,10 @@ int twwrite(dev, uio, ioflag)
* Determine if there is data available for reading
*/
-int twpoll(dev, events, p)
+int twpoll(dev, events, td)
dev_t dev;
int events;
- struct proc *p;
+ struct thread *td;
{
struct tw_sc *sc;
int s;
@@ -560,7 +560,7 @@ int twpoll(dev, events, p)
if(sc->sc_nextin != sc->sc_nextout)
revents |= events & (POLLIN | POLLRDNORM);
else
- selrecord(p, &sc->sc_selp);
+ selrecord(td, &sc->sc_selp);
}
splx(s);
return(revents);
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index 0fa16b5..09d2a7d 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -672,6 +672,8 @@ vesa_bios_init(void)
continue;
/* reject unsupported modes */
+#define DOTHIS 1
+#ifdef DOTHIS
#if 0
if ((vmode.v_modeattr & (V_MODESUPP | V_MODEOPTINFO
| V_MODENONVGA))
@@ -689,6 +691,7 @@ vesa_bios_init(void)
continue;
}
#endif
+#endif /* DOTHIS */
/* expand the array if necessary */
if (modes >= vesa_vmode_max) {
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 0adf3c8..4dc9818 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -285,7 +285,7 @@ COMPAT_ISA_DRIVER(wt, wtdriver);
* Open routine, called on every device open.
*/
static int
-wtopen (dev_t dev, int flag, int fmt, struct proc *p)
+wtopen (dev_t dev, int flag, int fmt, struct thread *td)
{
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
@@ -367,7 +367,7 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p)
* Close routine, called on last device close.
*/
static int
-wtclose (dev_t dev, int flags, int fmt, struct proc *p)
+wtclose (dev_t dev, int flags, int fmt, struct thread *td)
{
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
@@ -416,7 +416,7 @@ done:
* ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op
*/
static int
-wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p)
+wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct thread *td)
{
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
OpenPOWER on IntegriCloud