123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- /*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
- #define nil ((void*)0)
- typedef unsigned char u8;
- typedef signed char i8;
- typedef unsigned short u16;
- typedef signed short i16;
- typedef unsigned int u32;
- typedef signed int i32;
- typedef unsigned long long u64;
- typedef signed long long i64;
- typedef u64 usize;
- typedef i64 isize;
- typedef u32 Rune;
- typedef union FPdbleword FPdbleword;
- typedef u64 jmp_buf[10]; // for registers.
- // YUCK but ...
- #define YYSIZE_T usize
- #define alignas _Alignas
- #define static_assert _Static_assert
- #define JMPBUFSP 6
- #define JMPBUFPC 7
- #define JMPBUFARG1 8
- #define JMPBUFARG2 9
- #define JMPBUFDPC 0
- typedef unsigned int mpdigit; /* for /sys/include/mp.h */
- /* MXCSR */
- /* fcr */
- #define FPFTZ (1<<15) /* amd64 */
- #define FPINEX (1<<12)
- #define FPUNFL (1<<11)
- #define FPOVFL (1<<10)
- #define FPZDIV (1<<9)
- #define FPDNRM (1<<8) /* amd64 */
- #define FPINVAL (1<<7)
- #define FPDAZ (1<<6) /* amd64 */
- #define FPRNR (0<<13)
- #define FPRZ (3<<13)
- #define FPRPINF (2<<13)
- #define FPRNINF (1<<13)
- #define FPRMASK (3<<13)
- #define FPPEXT 0
- #define FPPSGL 0
- #define FPPDBL 0
- #define FPPMASK 0
- /* fsr */
- #define FPAINEX (1<<5)
- #define FPAUNFL (1<<4)
- #define FPAOVFL (1<<3)
- #define FPAZDIV (1<<2)
- #define FPADNRM (1<<1) /* not in plan 9 */
- #define FPAINVAL (1<<0)
- union FPdbleword
- {
- double x;
- struct { /* little endian */
- u32 lo;
- u32 hi;
- };
- };
- /*
- #if 0
- typedef char* va_list;
- #define va_start(list, start) list =\
- (sizeof(start) < 8?\
- (char*)((i64*)&(start)+1):\
- (char*)(&(start)+1))
- #define va_end(list)\
- USED(list)
- #define va_arg(list, mode)\
- ((sizeof(mode) == 1)?\
- ((list += 8), (mode*)list)[-8]:\
- (sizeof(mode) == 2)?\
- ((list += 8), (mode*)list)[-4]:\
- (sizeof(mode) == 4)?\
- ((list += 8), (mode*)list)[-2]:\
- ((list += sizeof(mode)), (mode*)list)[-1])
- #endif
- */
- typedef __builtin_va_list va_list;
- #define va_start(v,l) __builtin_va_start(v,l)
- #define va_end(v) __builtin_va_end(v)
- #define va_arg(v,l) __builtin_va_arg(v,l)
- #define va_copy(v,l) __builtin_va_copy(v,l)
- #define getcallerpc() ((usize)__builtin_return_address(0))
|