whitespace

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-15 19:25:33 +00:00
parent c278652d9a
commit 63a4cc271f

View file

@ -57,6 +57,7 @@ static unsigned conventional_memory = -1;
__dpmi_regs callback_regs; __dpmi_regs callback_regs;
void void
map_in_conventional_memory (void) map_in_conventional_memory (void)
{ {
@ -67,6 +68,7 @@ map_in_conventional_memory (void)
} }
} }
unsigned int unsigned int
ptr2real (void *ptr) ptr2real (void *ptr)
{ {
@ -74,6 +76,7 @@ ptr2real (void *ptr)
return (int) ptr - conventional_memory; return (int) ptr - conventional_memory;
} }
void * void *
real2ptr (unsigned int real) real2ptr (unsigned int real)
{ {
@ -81,58 +84,64 @@ real2ptr (unsigned int real)
return (void *) (real + conventional_memory); return (void *) (real + conventional_memory);
} }
void * void *
far2ptr (unsigned int farptr) far2ptr (unsigned int farptr)
{ {
return real2ptr (((farptr & ~0xffff) >> 12) + (farptr & 0xffff)); return real2ptr (((farptr & ~0xffff) >> 12) + (farptr & 0xffff));
} }
unsigned int unsigned int
ptr2far (void *ptr) ptr2far (void *ptr)
{ {
return ((ptr2real (ptr) & ~0xf) << 12) + (ptr2real (ptr) & 0xf); return ((ptr2real (ptr) & ~0xf) << 12) + (ptr2real (ptr) & 0xf);
} }
int int
dos_inportb (int port) dos_inportb (int port)
{ {
return inportb (port); return inportb (port);
} }
int int
dos_inportw (int port) dos_inportw (int port)
{ {
return inportw (port); return inportw (port);
} }
void void
dos_outportb (int port, int val) dos_outportb (int port, int val)
{ {
outportb (port, val); outportb (port, val);
} }
void void
dos_outportw (int port, int val) dos_outportw (int port, int val)
{ {
outportw (port, val); outportw (port, val);
} }
void void
dos_irqenable (void) dos_irqenable (void)
{ {
enable (); enable ();
} }
void void
dos_irqdisable (void) dos_irqdisable (void)
{ {
disable (); disable ();
} }
//
// Returns 0 on success
//
// Returns 0 on success
int int
dos_int86 (int vec) dos_int86 (int vec)
{ {
@ -143,6 +152,7 @@ dos_int86 (int vec)
return rc || (regs.x.flags & 1); return rc || (regs.x.flags & 1);
} }
int int
dos_int386 (int vec, regs_t * inregs, regs_t * outregs) dos_int386 (int vec, regs_t * inregs, regs_t * outregs)
{ {
@ -154,17 +164,14 @@ dos_int386 (int vec, regs_t * inregs, regs_t * outregs)
return rc || (outregs->x.flags & 1); return rc || (outregs->x.flags & 1);
} }
//
// Because of a quirk in dj's alloc-dos-memory wrapper, you need to keep // Because of a quirk in dj's alloc-dos-memory wrapper, you need to keep
// the seginfo structure around for when you free the mem. // the seginfo structure around for when you free the mem.
//
static _go32_dpmi_seginfo seginfo[10]; static _go32_dpmi_seginfo seginfo[10];
void * void *
dos_getmemory (int size) dos_getmemory (int size)
{ {
int rc; int rc;
_go32_dpmi_seginfo info; _go32_dpmi_seginfo info;
static int firsttime = 1; static int firsttime = 1;
@ -185,13 +192,12 @@ dos_getmemory (int size)
break; break;
seginfo[i] = info; seginfo[i] = info;
return real2ptr ((int) info.rm_segment << 4); return real2ptr ((int) info.rm_segment << 4);
} }
void void
dos_freememory (void *ptr) dos_freememory (void *ptr)
{ {
int i; int i;
int segment; int segment;
@ -202,9 +208,9 @@ dos_freememory (void *ptr)
seginfo[i].rm_segment = 0; seginfo[i].rm_segment = 0;
break; break;
} }
} }
static struct handlerhistory_s { static struct handlerhistory_s {
int intr; int intr;
_go32_dpmi_seginfo pm_oldvec; _go32_dpmi_seginfo pm_oldvec;
@ -231,13 +237,12 @@ dos_registerintr (int intr, void (*handler) (void))
_go32_dpmi_set_protected_mode_interrupt_vector (intr, &info); _go32_dpmi_set_protected_mode_interrupt_vector (intr, &info);
handlercount++; handlercount++;
} }
void void
dos_restoreintr (int intr) dos_restoreintr (int intr)
{ {
int i; int i;
struct handlerhistory_s *oldstuff; struct handlerhistory_s *oldstuff;
@ -252,21 +257,23 @@ dos_restoreintr (int intr)
break; break;
} }
} }
} }
void void
dos_usleep (int usecs) dos_usleep (int usecs)
{ {
usleep (usecs); usleep (usecs);
} }
int int
dos_getheapsize (void) dos_getheapsize (void)
{ {
return _go32_dpmi_remaining_physical_memory (); return _go32_dpmi_remaining_physical_memory ();
} }
int int
dos_lockmem (void *addr, int size) dos_lockmem (void *addr, int size)
{ {
@ -280,6 +287,7 @@ dos_lockmem (void *addr, int size)
return 0; return 0;
} }
int int
dos_unlockmem (void *addr, int size) dos_unlockmem (void *addr, int size)
{ {