/* * 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 unsigned char uint8_t; typedef signed char int8_t; typedef unsigned short uint16_t; typedef signed short int16_t; typedef unsigned int uint32_t; typedef unsigned int uint; typedef signed int int32_t; typedef long ssize_t; typedef unsigned long long uint64_t; typedef long long int64_t; typedef uint64_t uintptr; typedef uint64_t uintptr_t; typedef int64_t intptr_t; typedef unsigned long size_t; typedef u32 Rune; typedef union FPdbleword FPdbleword; typedef uint64_t jmp_buf[10]; // for registers. #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 */ uint lo; uint hi; }; }; /* #if 0 typedef char* va_list; #define va_start(list, start) list =\ (sizeof(start) < 8?\ (char*)((int64_t*)&(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() ((uintptr_t)__builtin_return_address(0))