* Functions to provide access to special i386 instructions.
* XXX - bezillions more are defined in locore.s but are not declared anywhere.
* $Id: cpufunc.h,v 1.9 1994/01/31 23:48:23 davidg Exp $
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_ 1
static inline int bdb(void)
* This roundabout method of returning a u_char helps stop gcc-1.40 from
* generating unnecessary movzbl's.
#define inb(port) ((u_char) u_int_inb(port))
* We use %%dx and not %1 here because i/o is done at %dx and not at
* %edx, while gcc-2.2.2 generates inferior code (movw instead of movl)
* if we tell it to load (u_short) port.
__asm
__volatile("inb %%dx,%0" : "=a" (data
) : "d" (port
));
outb(u_int port
, u_char data
)
register u_char al
asm("ax");
al
= data
; /* help gcc-1.40's register allocator */
__asm
__volatile("outb %0,%%dx" : : "a" (al
), "d" (port
));
__asm
__volatile("movl %%cr3, %%eax; movl %%eax, %%cr3" : : : "ax");
register u_char
*s1
= v1
, *s2
= v2
;
for (len
= 0; *s1
++ != '\0'; len
++)
struct quehead
*qh_rlink
;
register struct quehead
*element
= a
, *head
= b
;
element
->qh_link
= head
->qh_link
;
head
->qh_link
= (struct quehead
*)element
;
element
->qh_rlink
= (struct quehead
*)head
;
((struct quehead
*)(element
->qh_link
))->qh_rlink
= (struct quehead
*)element
;
register struct quehead
*element
= a
;
((struct quehead
*)(element
->qh_link
))->qh_rlink
= element
->qh_rlink
;
((struct quehead
*)(element
->qh_rlink
))->qh_link
= element
->qh_link
;
extern void insque
__P((void *, void *));
extern void remque
__P((void *));
void disable_intr
__P((void));
void enable_intr
__P((void));
u_char inb
__P((u_int port
));
void outb
__P((u_int port
, u_int data
)); /* XXX - incompat */
void load_cr0
__P((u_int cr0
));
void setidt
__P((int, void (*)(), int, int));
extern u_long
kvtop(void *);
extern void outw(int /*u_short*/, int /*u_short*/); /* XXX inline!*/
extern void outsb(int /*u_short*/, void *, size_t);
extern void outsw(int /*u_short*/, void *, size_t);
extern void insw(int /*u_short*/, void *, size_t);
extern void fillw(int /*u_short*/, void *, size_t);
extern void filli(int, void *, size_t);
#endif /* _MACHINE_CPUFUNC_H_ */