wok-6.x annotate linld/stuff/src/CRTL.H @ rev 20477
Rebuild perl in 32 bits
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 17 20:44:06 2018 +0200 (2018-10-17) |
parents | 9e8f9b54bd83 |
children | a5b6457fb890 |
rev | line source |
---|---|
pascal@19515 | 1 // This file is distributed under GPL |
pascal@19515 | 2 // |
pascal@19515 | 3 // Bare bones of C runtime library |
pascal@19515 | 4 |
pascal@19515 | 5 #define MK_FP(seg,ofs) ((void _seg *)(seg) + (void near *)(ofs)) |
pascal@19515 | 6 #define FP_SEG(fp) ((unsigned) (void _seg*) (void far*)(fp)) |
pascal@19515 | 7 #define FP_OFF(fp) ((unsigned) (fp)) |
pascal@19515 | 8 |
pascal@19515 | 9 const unsigned MIN_STACK = 0x400; |
pascal@19515 | 10 const unsigned MAX_MALLOC = 0xF000; |
pascal@19515 | 11 |
pascal@19636 | 12 const char A_RDONLY = 1; // for fileattr() |
pascal@19636 | 13 const char A_HIDDEN = 2; |
pascal@19636 | 14 const char A_SYSTEM = 4; |
pascal@19636 | 15 const char A_LABEL = 8; |
pascal@19636 | 16 const char A_DIRECTORY = 16; |
pascal@19636 | 17 const char A_ARCHIVE = 32; |
pascal@19538 | 18 |
pascal@19538 | 19 |
pascal@19636 | 20 const char O_RDONLY = 0; // for open() |
pascal@19636 | 21 const char O_BINARY = 0; |
pascal@19515 | 22 |
pascal@19515 | 23 extern char text_start; extern char text_end; |
pascal@19515 | 24 extern char data_start; extern char data_end; |
pascal@19515 | 25 extern char bss_start; extern char bss_end; |
pascal@19515 | 26 extern char* heap_top; |
pascal@19515 | 27 |
pascal@19515 | 28 void parse_cmdline(); |
pascal@19538 | 29 extern "C" char* strcatb(const char* a,const char* b); |
pascal@19515 | 30 extern "C" int strhead(const char* a,const char* b); |
pascal@19538 | 31 extern "C" int fileattr(const char* name); |
pascal@19546 | 32 //extern "C" int open(const char* name, int flags); |
pascal@19546 | 33 extern "C" int open(const char* name); |
pascal@19515 | 34 extern "C" int close(int fd); |
pascal@19515 | 35 extern "C" void exit(int n); |
pascal@19515 | 36 extern "C" void abort(); |
pascal@19515 | 37 extern "C" int read(int fd, void* data, int sz); |
pascal@19515 | 38 extern "C" int write(int fd, const void* data, int sz); |
pascal@19899 | 39 extern "C" long lseekset(int fd, unsigned long sz); |
pascal@19636 | 40 extern "C" int puts(const char* s); |
pascal@19515 | 41 extern "C" unsigned long strtol(const char *s); |
pascal@19515 | 42 |
pascal@19515 | 43 // Extensions |
pascal@19515 | 44 #define cli() do { asm { cli } } while(0) |
pascal@19515 | 45 #define sti() do { asm { sti } } while(0) |
pascal@19515 | 46 #define int3() do { asm { db 0cch } } while(0) |
pascal@19515 | 47 #define nop() do { asm { db 90h } } while(0) |
pascal@19515 | 48 extern char no_exit; |
pascal@19515 | 49 extern "C" int die(const char* msg); |
pascal@19515 | 50 extern "C" char* malloc_or_die(unsigned size); |
pascal@19538 | 51 extern "C" unsigned long* malloc_bufv_or_die(struct image_himem *m); |