minix/commands/dis386/type.h
Gianluca Guida cc17b27a2b Build NetBSD libc library in world in ELF mode.
3 sets of libraries are built now:
  . ack: all libraries that ack can compile (/usr/lib/i386/)
  . clang+elf: all libraries with minix headers (/usr/lib/)
  . clang+elf: all libraries with netbsd headers (/usr/netbsd/)

Once everything can be compiled with netbsd libraries and headers, the
/usr/netbsd hierarchy will be obsolete and its libraries compiled with
netbsd headers will be installed in /usr/lib, and its headers
in /usr/include. (i.e. minix libc and current minix headers set
will be gone.)

To use the NetBSD libc system (libraries + headers) before
it is the default libc, see:
   http://wiki.minix3.org/en/DevelopersGuide/UsingNetBSDCode
This wiki page also documents the maintenance of the patch
files of minix-specific changes to imported NetBSD code.

Changes in this commit:
  . libsys: Add NBSD compilation and create a safe NBSD-based libc.
  . Port rest of libraries (except libddekit) to new header system.
  . Enable compilation of libddekit with new headers.
  . Enable kernel compilation with new headers.
  . Enable drivers compilation with new headers.
  . Port legacy commands to new headers and libc.
  . Port servers to new headers.
  . Add <sys/sigcontext.h> in compat library.
  . Remove dependency file in tree.
  . Enable compilation of common/lib/libc/atomic in libsys
  . Do not generate RCSID strings in libc.
  . Temporarily disable zoneinfo as they are incompatible with NetBSD format
  . obj-nbsd for .gitignore
  . Procfs: use only integer arithmetic. (Antoine Leca)
  . Increase ramdisk size to create NBSD-based images.
  . Remove INCSYMLINKS handling hack.
  . Add nbsd_include/sys/exec_elf.h
  . Enable ELF compilation with NBSD libc.
  . Add 'make nbsdsrc' in tools to download reference NetBSD sources.
  . Automate minix-port.patch creation.
  . Avoid using fstavfs() as it is *extremely* slow and unneeded.
  . Set err() as PRIVATE to avoid name clash with libc.
  . [NBSD] servers/vm: remove compilation warnings.
  . u32 is not a long in NBSD headers.
  . UPDATING info on netbsd hierarchy
  . commands fixes for netbsd libc
2011-06-24 11:46:30 +02:00

214 lines
5 KiB
C

/* type.h - types for db.
*
* $Id: type.h,v 1.1 1997/10/20 12:00:00 cwr Exp cwr $
*/
typedef unsigned long bigcount_t;
typedef unsigned long flags_t;
typedef int bool_pt;
typedef char bool_t;
typedef int char_pt;
typedef int char16_t; /* ASCII character possibly with scan code */
typedef unsigned count_t;
typedef unsigned long offset_t;
typedef unsigned opcode_pt; /* promote to unsigned and not int */
typedef int (*pfi_t)();
typedef void (*pfv_t)();
typedef unsigned long physoff_t;
typedef unsigned peekboff_t;
typedef unsigned peekoff_t;
typedef int peekseg_t;
typedef unsigned port_t;
typedef int reg_pt;
typedef unsigned char reg_t;
typedef unsigned segment_t;
typedef long soffset_t;
typedef int su8_pt;
typedef int su16_t;
typedef unsigned u4_pt; /* promote to unsigned and not int */
typedef unsigned u8_pt;
typedef unsigned u16_pt;
struct address_s
{
offset_t off;
offset_t base;
};
struct desctableptr_s {
u16_t limit;
u32_t base; /* really u24_t + pad for 286 */
};
struct regs_s
{
offset_t ax;
offset_t bx;
offset_t cx;
offset_t dx;
offset_t si;
offset_t di;
offset_t bp;
offset_t sp;
offset_t dsbase;
offset_t esbase;
offset_t fsbase;
offset_t gsbase;
offset_t ssbase;
offset_t csbase;
offset_t ip;
flags_t f;
offset_t ds;
offset_t es;
offset_t fs;
offset_t gs;
offset_t ss;
offset_t cs;
};
struct specregs_s
{
u32_t cr0; /* control regs, cr0 is msw + pad for 286 */
u32_t cr2;
u32_t cr3;
u32_t dr0; /* debug regs */
u32_t dr1;
u32_t dr2;
u32_t dr3;
u32_t dr6;
u32_t dr7;
u32_t tr6; /* test regs */
u32_t tr7;
u16_t gdtlimit;
u32_t gdtbase; /* depend on 16-bit compiler so no long align */
u16_t gdtpad;
u16_t idtlimit;
u32_t idtbase;
u16_t idtpad;
u16_t ldtlimit;
u32_t ldtbase;
u16_t ldt;
u16_t tr; /* task register */
u16_t trpad;
};
/* prototypes */
#if __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
/* library, very few! */
void *memcpy P((void *dst, const void *src, unsigned size));
void *memmove P((void *dst, const void *src, unsigned size));
unsigned strlen P((const char *s));
char *strncpy P((char *dst, const char *src, unsigned size));
/* db.c */
void db_main P((void));
void get_kbd_state P(());
void get_scr_state P(());
void info P((void));
void reboot P((void));
void reset_kbd_state P(());
#ifndef __NBSD_LIBC
/* getline.c */
char *getline P((char *startline, unsigned maxlength, unsigned offset));
#endif
/* ihexload.c */
void ihexload P((void));
/* io.c */
void can_itty P((void));
void can_keyboard P((void));
void can_otty P((void));
void can_screen P((void));
void closeio P((void));
void closestring P((void));
void enab_itty P((void));
void enab_keyboard P((void));
void enab_otty P((void));
void enab_screen P((void));
void flipcase P((void));
u8_pt get8 P((void));
u16_pt get16 P((void));
u32_t get32 P((void));
char16_t inchar P((void));
char_pt mytolower P((char_pt ch));
void openio P((void));
void openstring P((char *string, int length));
void outbyte P((char_pt byte));
void outcomma P((void));
void outh4 P((u4_pt num));
void outh8 P((u8_pt num));
void outh16 P((u16_pt num));
void outh32 P((u32_t num));
bool_pt outnl P((void));
count_t outsegaddr P((struct address_s *ap, offset_t addr));
count_t outsegreg P((offset_t num));
void outspace P((void));
void outstr P((char *s));
void outtab P((void));
void outustr P((char *s));
void set_tty P((void));
void show_db_screen P((void));
void show_user_screen P((void));
count_t stringpos P((void));
count_t stringtab P((void));
char_pt testchar P((void));
/* lib88.s */
int get_privilege P((void));
unsigned get_processor P((void));
unsigned in16portb P((port_t port));
physoff_t linear2addr P((segment_t segment, u16_pt offset));
void oportb P((port_t port, u8_pt value));
u8_pt peek_byte P((physoff_t offset));
u16_pt peek_word P((physoff_t offset));
u32_t peek_dword P((physoff_t offset));
void poke_byte P((physoff_t offset, u8_pt value));
void poke_word P((physoff_t offset, u16_pt value));
#ifdef N_TEXT
void symswap P((struct nlist *left, struct nlist *right,
segment_t tableseg, unsigned length));
#endif
/* pcio.c */
void kbdclose P((void));
char_pt kbdin P((void));
void kbdioctl P((int command));
void kbdopen P((void));
void kbdout P((int c));
/* screen.s */
void scrclose P((void));
void scrioctl P((int command));
char_pt scrin P((void));
void scropen P((void));
void scrout P((char_pt c));
/* sym.c */
#ifdef N_TEXT
struct nlist *findsname P((char *name, int where, bool_pt allflag));
struct nlist *findsval P((offset_t value, int where));
struct nlist *findrval P((offset_t value, int where));
void outsym P((struct nlist *sp, offset_t off));
void outrel P((struct nlist *sp, offset_t off));
#endif
void setproc P((char_pt c, struct address_s *pdptr, struct address_s *pmptr));
void syminit P((void));
/* tty.s */
void ttyclose P((void));
void ttyioctl P((int command));
char_pt ttyin P((void));
void ttyopen P((void));
void ttyout P((char_pt c));
/* unasm.c */
bool_pt puti P((void));