summaryrefslogtreecommitdiff
path: root/os/boot/mpc/lib.h
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
commit74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (patch)
treec6e220ba61db3a6ea4052e6841296d829654e664 /os/boot/mpc/lib.h
parent46439007cf417cbd9ac8049bb4122c890097a0fa (diff)
20060303
Diffstat (limited to 'os/boot/mpc/lib.h')
-rw-r--r--os/boot/mpc/lib.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/os/boot/mpc/lib.h b/os/boot/mpc/lib.h
new file mode 100644
index 00000000..1eb0532d
--- /dev/null
+++ b/os/boot/mpc/lib.h
@@ -0,0 +1,106 @@
+/*
+ * functions (possibly) linked in, complete, from libc.
+ */
+
+/*
+ * mem routines
+ */
+extern void* memccpy(void*, void*, int, long);
+extern void* memset(void*, int, long);
+extern int memcmp(void*, void*, long);
+extern void* memmove(void*, void*, long);
+extern void* memchr(void*, int, long);
+
+/*
+ * string routines
+ */
+extern char* strcat(char*, char*);
+extern char* strchr(char*, char);
+extern int strcmp(char*, char*);
+extern char* strcpy(char*, char*);
+extern char* strncat(char*, char*, long);
+extern char* strncpy(char*, char*, long);
+extern int strncmp(char*, char*, long);
+extern long strlen(char*);
+extern char* strrchr(char*, char);
+extern char* strstr(char*, char*);
+
+/*
+ * print routines
+ * Fconv isn't used but is defined to satisfy prototypes in libg.h
+ * that are never called.
+ */
+typedef struct Fconv Fconv;
+
+extern char* donprint(char*, char*, char*, void*);
+extern int sprint(char*, char*, ...);
+extern int print(char*, ...);
+
+#define PRINTSIZE 256
+
+/*
+ * one-of-a-kind
+ */
+extern int atoi(char*);
+extern long strtol(char*, char**, int);
+extern ulong strtoul(char*, char**, int);
+extern long end;
+
+/*
+ * Syscall data structures
+ */
+
+#define MORDER 0x0003 /* mask for bits defining order of mounting */
+#define MREPL 0x0000 /* mount replaces object */
+#define MBEFORE 0x0001 /* mount goes before others in union directory */
+#define MAFTER 0x0002 /* mount goes after others in union directory */
+#define MCREATE 0x0004 /* permit creation in mounted directory */
+#define MMASK 0x0007 /* all bits on */
+
+#define OREAD 0 /* open for read */
+#define OWRITE 1 /* write */
+#define ORDWR 2 /* read and write */
+#define OEXEC 3 /* execute, == read but check execute permission */
+#define OTRUNC 16 /* or'ed in (except for exec), truncate file first */
+#define OCEXEC 32 /* or'ed in, close on exec */
+#define ORCLOSE 64 /* or'ed in, remove on close */
+
+#define NCONT 0 /* continue after note */
+#define NDFLT 1 /* terminate after note */
+
+typedef struct Qid Qid;
+typedef struct Dir Dir;
+typedef struct Waitmsg Waitmsg;
+
+#define ERRLEN 64
+#define DIRLEN 116
+#define NAMELEN 28
+
+struct Qid
+{
+ ulong path;
+ ulong vers;
+};
+
+struct Dir
+{
+ char name[NAMELEN];
+ char uid[NAMELEN];
+ char gid[NAMELEN];
+ Qid qid;
+ ulong mode;
+ long atime;
+ long mtime;
+ vlong length;
+ short type;
+ short dev;
+};
+
+struct Waitmsg
+{
+ int pid; /* of loved one */
+ int status; /* unused; a placeholder */
+ ulong time[3]; /* of loved one */
+ char msg[ERRLEN];
+};
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))