Browse Source

Reintroducing headers, toolset and libc (#730)

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 1 year ago
parent
commit
3480514be3
100 changed files with 168 additions and 3922 deletions
  1. 1 0
      amd64/include/u.h
  2. 0 2
      arm/bin/ape/psh
  3. 0 82
      arm/include/ape/float.h
  4. 0 87
      arm/include/ape/math.h
  5. 0 25
      arm/include/ape/stdarg.h
  6. 0 44
      arm/include/ape/ureg.h
  7. 0 75
      arm/include/u.h
  8. 0 35
      arm/include/ureg.h
  9. BIN
      arm/inflate
  10. 0 6
      arm/mkfile
  11. 0 2
      mips/bin/ape/psh
  12. 0 82
      mips/include/ape/float.h
  13. 0 87
      mips/include/ape/math.h
  14. 0 27
      mips/include/ape/stdarg.h
  15. 0 61
      mips/include/ape/ureg.h
  16. 0 62
      mips/include/mips2ureg.h
  17. 0 78
      mips/include/u.h
  18. 0 53
      mips/include/ureg.h
  19. 0 6
      mips/mkfile
  20. 0 82
      power/include/ape/float.h
  21. 0 87
      power/include/ape/math.h
  22. 0 27
      power/include/ape/stdarg.h
  23. 0 59
      power/include/ape/ureg.h
  24. 0 94
      power/include/u.h
  25. 0 60
      power/include/ureg.h
  26. 0 6
      power/mkfile
  27. 0 96
      power64/include/u.h
  28. 0 53
      power64/include/ureg.h
  29. 0 6
      power64/mkfile
  30. 0 82
      sparc/include/ape/float.h
  31. 0 87
      sparc/include/ape/math.h
  32. 0 27
      sparc/include/ape/stdarg.h
  33. 0 62
      sparc/include/ape/ureg.h
  34. 0 74
      sparc/include/u.h
  35. 0 54
      sparc/include/ureg.h
  36. 0 7
      sparc/mkfile
  37. 96 110
      sys/include/libc.h
  38. 0 74
      sys/include/libsec.h
  39. 1 28
      sys/include/mp.h
  40. 0 12
      sys/include/tos.h
  41. 0 40
      sys/src/libc/386/387/asin.s
  42. 0 5
      sys/src/libc/386/387/atan.s
  43. 0 5
      sys/src/libc/386/387/atan2.s
  44. 0 13
      sys/src/libc/386/387/exp.s
  45. 0 31
      sys/src/libc/386/387/log.s
  46. 0 9
      sys/src/libc/386/387/sin.s
  47. 0 16
      sys/src/libc/386/387/sqrt.s
  48. 0 5
      sys/src/libc/386/387/tan.s
  49. 0 4
      sys/src/libc/386/argv0.s
  50. 0 75
      sys/src/libc/386/atom.s
  51. 0 8
      sys/src/libc/386/cycles.s
  52. 0 4
      sys/src/libc/386/getcallerpc.s
  53. 0 27
      sys/src/libc/386/getfcr.s
  54. 0 21
      sys/src/libc/386/main9.s
  55. 0 38
      sys/src/libc/386/main9p.s
  56. 0 53
      sys/src/libc/386/memccpy.s
  57. 0 23
      sys/src/libc/386/memchr.s
  58. 0 47
      sys/src/libc/386/memcmp.s
  59. 0 57
      sys/src/libc/386/memcpy.s
  60. 0 71
      sys/src/libc/386/memmove.s
  61. 0 35
      sys/src/libc/386/memset.s
  62. 0 12
      sys/src/libc/386/muldiv.s
  63. 0 25
      sys/src/libc/386/notejmp.c
  64. 0 18
      sys/src/libc/386/setjmp.s
  65. 0 16
      sys/src/libc/386/sqrt.s
  66. 0 43
      sys/src/libc/386/strcat.s
  67. 0 38
      sys/src/libc/386/strchr.s
  68. 0 35
      sys/src/libc/386/strcpy.s
  69. 0 16
      sys/src/libc/386/strlen.s
  70. 0 6
      sys/src/libc/386/tas.s
  71. 0 62
      sys/src/libc/386/vlop.s
  72. 0 755
      sys/src/libc/386/vlrt.c
  73. 0 17
      sys/src/libc/9sys/abort.c
  74. 1 1
      sys/src/libc/9sys/access.c
  75. 9 9
      sys/src/libc/9sys/announce.c
  76. 6 6
      sys/src/libc/9sys/dial.c
  77. 1 1
      sys/src/libc/9sys/dirstat.c
  78. 1 1
      sys/src/libc/9sys/dirwstat.c
  79. 2 2
      sys/src/libc/9sys/getenv.c
  80. 1 1
      sys/src/libc/9sys/getnetconninfo.c
  81. 0 85
      sys/src/libc/9sys/nsec.c
  82. 1 1
      sys/src/libc/9sys/postnote.c
  83. 1 1
      sys/src/libc/9sys/pushssl.c
  84. 2 2
      sys/src/libc/9sys/pushtls.c
  85. 1 1
      sys/src/libc/9sys/putenv.c
  86. 3 2
      sys/src/libc/9sys/qlock.c
  87. 21 18
      sys/src/libc/9sys/read.c
  88. 1 1
      sys/src/libc/9sys/setnetmtpt.c
  89. 3 3
      sys/src/libc/9sys/sysfatal.c
  90. 1 1
      sys/src/libc/9sys/syslog.c
  91. 1 1
      sys/src/libc/9sys/werrstr.c
  92. 14 18
      sys/src/libc/9sys/write.c
  93. 0 1
      sys/src/libc/9syscall/9syscall.json
  94. 0 4
      sys/src/libc/amd64/9asm/argv0.s
  95. 0 66
      sys/src/libc/amd64/9asm/atom.s
  96. 0 5
      sys/src/libc/amd64/9asm/cycles.s
  97. 0 3
      sys/src/libc/amd64/9asm/getcallerpc.s
  98. 0 38
      sys/src/libc/amd64/9asm/getfcr.s
  99. 0 19
      sys/src/libc/amd64/9asm/main9.s
  100. 0 0
      sys/src/libc/amd64/9asm/main9p.s

+ 1 - 0
amd64/include/u.h

@@ -15,6 +15,7 @@ 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;

+ 0 - 2
arm/bin/ape/psh

@@ -1,2 +0,0 @@
-#!/bin/rc
-exec /rc/bin/ape/psh $*

+ 0 - 82
arm/include/ape/float.h

@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __FLOAT
-#define __FLOAT
-/* IEEE, default rounding */
-
-#define FLT_ROUNDS	1
-#define FLT_RADIX	2
-
-#define FLT_DIG		6
-#define FLT_EPSILON	1.19209290e-07
-#define FLT_MANT_DIG	24
-#define FLT_MAX		3.40282347e+38
-#define FLT_MAX_10_EXP	38
-#define FLT_MAX_EXP	128
-#define FLT_MIN		1.17549435e-38
-#define FLT_MIN_10_EXP	-37
-#define FLT_MIN_EXP	-125
-
-#define DBL_DIG		15
-#define DBL_EPSILON	2.2204460492503131e-16
-#define DBL_MANT_DIG	53
-#define DBL_MAX		1.797693134862315708145e+308
-#define DBL_MAX_10_EXP	308
-#define DBL_MAX_EXP	1024
-#define DBL_MIN		2.225073858507201383090233e-308
-#define DBL_MIN_10_EXP	-307
-#define DBL_MIN_EXP	-1021
-#define LDBL_MANT_DIG	DBL_MANT_DIG
-#define LDBL_EPSILON	DBL_EPSILON
-#define LDBL_DIG	DBL_DIG
-#define LDBL_MIN_EXP	DBL_MIN_EXP
-#define LDBL_MIN	DBL_MIN
-#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
-#define LDBL_MAX_EXP	DBL_MAX_EXP
-#define LDBL_MAX	DBL_MAX
-#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
-
-typedef 	union FPdbleword FPdbleword;
-union FPdbleword
-{
-	double	x;
-	struct {	/* little endian */
-		long lo;
-		long hi;
-	};
-};
-
-#ifdef _RESEARCH_SOURCE
-/* define stuff needed for floating conversion */
-#define IEEE_8087	1
-#define Sudden_Underflow 1
-#endif
-#ifdef _PLAN9_SOURCE
-/* FCR */
-#define	FPINEX	(1<<5)
-#define	FPOVFL	(1<<3)
-#define	FPUNFL	((1<<4)|(1<<1))
-#define	FPZDIV	(1<<2)
-#define	FPRNR	(0<<10)
-#define	FPRZ	(3<<10)
-#define	FPRPINF	(2<<10)
-#define	FPRNINF	(1<<10)
-#define	FPRMASK	(3<<10)
-#define	FPPEXT	(3<<8)
-#define	FPPSGL	(0<<8)
-#define	FPPDBL	(2<<8)
-#define	FPPMASK	(3<<8)
-/* FSR */
-#define	FPAINEX	FPINEX
-#define	FPAOVFL	FPOVFL
-#define	FPAUNFL	FPUNFL
-#define	FPAZDIV	FPZDIV
-#endif
-#endif /* __FLOAT */

+ 0 - 87
arm/include/ape/math.h

@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __MATH
-#define __MATH
-#pragma lib "/$M/lib/ape/libap.a"
-
-/* a HUGE_VAL appropriate for IEEE double-precision */
-/* the correct value, 1.797693134862316e+308, causes a ken overflow */
-#define HUGE_VAL 1.79769313486231e+308
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern double acos(double);
-extern double asin(double);
-extern double atan(double);
-extern double atan2(double, double);
-extern double cos(double);
-extern double hypot(double, double);
-extern double sin(double);
-extern double tan(double);
-extern double cosh(double);
-extern double sinh(double);
-extern double tanh(double);
-extern double exp(double);
-extern double frexp(double, int *);
-extern double ldexp(double, int);
-extern double log(double);
-extern double log10(double);
-extern double modf(double, double *);
-extern double pow(double, double);
-extern double sqrt(double);
-extern double ceil(double);
-extern double fabs(double);
-extern double floor(double);
-extern double fmod(double, double);
-extern double NaN(void);
-extern int isNaN(double);
-extern double Inf(int);
-extern int isInf(double, int);
-
-#ifdef _RESEARCH_SOURCE
-/* does >> treat left operand as unsigned ? */
-#define Unsigned_Shifts 1
-#define	M_E		2.7182818284590452354	/* e */
-#define	M_LOG2E		1.4426950408889634074	/* log 2e */
-#define	M_LOG10E	0.43429448190325182765	/* log 10e */
-#define	M_LN2		0.69314718055994530942	/* log e2 */
-#define	M_LN10		2.30258509299404568402	/* log e10 */
-#define	M_PI		3.14159265358979323846	/* pi */
-#define	M_PI_2		1.57079632679489661923	/* pi/2 */
-#define	M_PI_4		0.78539816339744830962	/* pi/4 */
-#define	M_1_PI		0.31830988618379067154	/* 1/pi */
-#define	M_2_PI		0.63661977236758134308	/* 2/pi */
-#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
-#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
-#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
-
-extern double hypot(double, double);
-extern double erf(double);
-extern double erfc(double);
-extern double j0(double);
-extern double y0(double);
-extern double j1(double);
-extern double y1(double);
-extern double jn(int, double);
-extern double yn(int, double);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#define isnan(x) isNaN(x)
-#define isinf(x) isInf(x, 0)
-
-#endif /* __MATH */

+ 0 - 25
arm/include/ape/stdarg.h

@@ -1,25 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __STDARG
-#define __STDARG
-
-typedef char *va_list;
-
-#define va_start(list, start) list = (sizeof(start)<4 ? (char *)((int *)&(start)+1) : \
-(char *)(&(start)+1))
-#define va_end(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-4]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-2]:\
-		((list += sizeof(mode)), (mode*)list)[-1])
-
-#endif /* __STDARG */

+ 0 - 44
arm/include/ape/ureg.h

@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __UREG_H
-#define __UREG_H
-#if !defined(_PLAN9_SOURCE)
-    This header file is an extension to ANSI/POSIX
-#endif
-
-struct Ureg
-{
-	unsigned long	r0;
-	unsigned long	r1;
-	unsigned long	r2;
-	unsigned long	r3;
-	unsigned long	r4;
-	unsigned long	r5;
-	unsigned long	r6;
-	unsigned long	r7;
-	unsigned long	r8;
-	unsigned long	r9;
-	unsigned long	r10;
-	unsigned long	r11;
-	unsigned long	r12;	/* sb */
-	union {
-		unsigned long	r13;
-		unsigned long	sp;
-	};
-	union {
-		unsigned long	r14;
-		unsigned long	link;
-	};
-	unsigned long	type;	/* of exception */
-	unsigned long	psr;
-	unsigned long	pc;	/* interrupted addr */
-};
-
-#endif

+ 0 - 75
arm/include/u.h

@@ -1,75 +0,0 @@
-/*
- * 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 short	ushort;
-typedef	unsigned char	uchar;
-typedef	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef unsigned long	uintptr;
-typedef unsigned long	usize;
-typedef	uint		Rune;
-typedef 	union FPdbleword FPdbleword;
-typedef long	jmp_buf[2];
-#define	JMPBUFSP	0
-#define	JMPBUFPC	1
-#define	JMPBUFDPC	0
-typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
-typedef unsigned char u8int;
-typedef unsigned short u16int;
-typedef unsigned int	u32int;
-typedef unsigned long long u64int;
-
-/* VFP FCR */
-#define	FPINEX	(1<<12)			/* trap enables for exceptions */
-#define	FPUNFL	(1<<11)
-#define	FPOVFL	(1<<10)
-#define	FPZDIV	(1<<9)
-#define	FPINVAL	(1<<8)
-#define	FPRNR	(0<<22)
-#define	FPRZ	(1<<22)
-#define	FPRPINF	(2<<22)
-#define	FPRNINF	(3<<22)
-#define	FPRMASK	(3<<22)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-/* FSR */
-#define	FPAINEX	(1<<4)			/* accrued exceptions */
-#define	FPAUNFL	(1<<3)
-#define	FPAOVFL	(1<<2)
-#define	FPAZDIV	(1<<1)
-#define	FPAINVAL	(1<<0)
-union FPdbleword
-{
-	double	x;
-	struct {	/* little endian */
-		uint32_t lo;
-		uint32_t hi;
-	};
-};
-
-typedef	char*	va_list;
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)\
-	USED(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-4]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-2]:\
-		((list += sizeof(mode)), (mode*)list)[-1])

+ 0 - 35
arm/include/ureg.h

@@ -1,35 +0,0 @@
-/*
- * 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.
- */
-
-typedef struct Ureg {
-	uint32_t	r0;
-	uint32_t	r1;
-	uint32_t	r2;
-	uint32_t	r3;
-	uint32_t	r4;
-	uint32_t	r5;
-	uint32_t	r6;
-	uint32_t	r7;
-	uint32_t	r8;
-	uint32_t	r9;
-	uint32_t	r10;
-	uint32_t	r11;
-	uint32_t	r12;	/* sb */
-	union {
-		uint32_t	r13;
-		uint32_t	sp;
-	};
-	union {
-		uint32_t	r14;
-		uint32_t	link;
-	};
-	uint32_t	type;	/* of exception */
-	uint32_t	psr;
-	uint32_t	pc;	/* interrupted addr */
-} Ureg;

BIN
arm/inflate


+ 0 - 6
arm/mkfile

@@ -1,6 +0,0 @@
-</sys/src/mkfile.proto
-
-CC=5c
-LD=5l
-O=5
-AS=5a

+ 0 - 2
mips/bin/ape/psh

@@ -1,2 +0,0 @@
-#!/bin/rc
-exec /rc/bin/ape/psh $*

+ 0 - 82
mips/include/ape/float.h

@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __FLOAT
-#define __FLOAT
-/* IEEE, default rounding */
-
-#define FLT_ROUNDS	1
-#define FLT_RADIX	2
-
-#define FLT_DIG		6
-#define FLT_EPSILON	1.19209290e-07
-#define FLT_MANT_DIG	24
-#define FLT_MAX		3.40282347e+38
-#define FLT_MAX_10_EXP	38
-#define FLT_MAX_EXP	128
-#define FLT_MIN		1.17549435e-38
-#define FLT_MIN_10_EXP	-37
-#define FLT_MIN_EXP	-125
-
-#define DBL_DIG		15
-#define DBL_EPSILON	2.2204460492503131e-16
-#define DBL_MANT_DIG	53
-#define DBL_MAX		1.797693134862315708145e+308
-#define DBL_MAX_10_EXP	308
-#define DBL_MAX_EXP	1024
-#define DBL_MIN		2.225073858507201383090233e-308
-#define DBL_MIN_10_EXP	-307
-#define DBL_MIN_EXP	-1021
-#define LDBL_MANT_DIG	DBL_MANT_DIG
-#define LDBL_EPSILON	DBL_EPSILON
-#define LDBL_DIG	DBL_DIG
-#define LDBL_MIN_EXP	DBL_MIN_EXP
-#define LDBL_MIN	DBL_MIN
-#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
-#define LDBL_MAX_EXP	DBL_MAX_EXP
-#define LDBL_MAX	DBL_MAX
-#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
-
-typedef 	union FPdbleword FPdbleword;
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		long hi;
-		long lo;
-	};
-};
-
-#ifdef _RESEARCH_SOURCE
-/* define stuff needed for floating conversion */
-#define IEEE_MC68k	1
-#define Sudden_Underflow 1
-#endif
-#ifdef _PLAN9_SOURCE
-/* FCR */
-#define	FPINEX	(1<<7)
-#define	FPOVFL	(1<<9)
-#define	FPUNFL	(1<<8)
-#define	FPZDIV	(1<<10)
-#define	FPRNR	(0<<0)
-#define	FPRZ	(1<<0)
-#define	FPRPINF	(2<<0)
-#define	FPRNINF	(3<<0)
-#define	FPRMASK	(3<<0)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-/* FSR */
-#define	FPAINEX	(1<<2)
-#define	FPAOVFL	(1<<4)
-#define	FPAUNFL	(1<<3)
-#define	FPAZDIV	(1<<5)
-#endif
-#endif /* __FLOAT */

+ 0 - 87
mips/include/ape/math.h

@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __MATH
-#define __MATH
-#pragma lib "/$M/lib/ape/libap.a"
-
-/* a HUGE_VAL appropriate for IEEE double-precision */
-/* the correct value, 1.797693134862316e+308, causes a ken overflow */
-#define HUGE_VAL 1.79769313486231e+308
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern double acos(double);
-extern double asin(double);
-extern double atan(double);
-extern double atan2(double, double);
-extern double cos(double);
-extern double hypot(double, double);
-extern double sin(double);
-extern double tan(double);
-extern double cosh(double);
-extern double sinh(double);
-extern double tanh(double);
-extern double exp(double);
-extern double frexp(double, int *);
-extern double ldexp(double, int);
-extern double log(double);
-extern double log10(double);
-extern double modf(double, double *);
-extern double pow(double, double);
-extern double sqrt(double);
-extern double ceil(double);
-extern double fabs(double);
-extern double floor(double);
-extern double fmod(double, double);
-extern double NaN(void);
-extern int isNaN(double);
-extern double Inf(int);
-extern int isInf(double, int);
-
-#ifdef _RESEARCH_SOURCE
-/* does >> treat left operand as unsigned ? */
-#define Unsigned_Shifts 1
-#define	M_E		2.7182818284590452354	/* e */
-#define	M_LOG2E		1.4426950408889634074	/* log 2e */
-#define	M_LOG10E	0.43429448190325182765	/* log 10e */
-#define	M_LN2		0.69314718055994530942	/* log e2 */
-#define	M_LN10		2.30258509299404568402	/* log e10 */
-#define	M_PI		3.14159265358979323846	/* pi */
-#define	M_PI_2		1.57079632679489661923	/* pi/2 */
-#define	M_PI_4		0.78539816339744830962	/* pi/4 */
-#define	M_1_PI		0.31830988618379067154	/* 1/pi */
-#define	M_2_PI		0.63661977236758134308	/* 2/pi */
-#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
-#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
-#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
-
-extern double hypot(double, double);
-extern double erf(double);
-extern double erfc(double);
-extern double j0(double);
-extern double y0(double);
-extern double j1(double);
-extern double y1(double);
-extern double jn(int, double);
-extern double yn(int, double);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#define isnan(x) isNaN(x)
-#define isinf(x) isInf(x, 0)
-
-#endif /* __MATH */

+ 0 - 27
mips/include/ape/stdarg.h

@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __STDARG
-#define __STDARG
-
-typedef char *va_list;
-
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-1]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-1]:\
-		((list += sizeof(mode)), (mode*)list)[-1])
-
-#endif /* __STDARG */

+ 0 - 61
mips/include/ape/ureg.h

@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __UREG_H
-#define __UREG_H
-#if !defined(_PLAN9_SOURCE)
-    This header file is an extension to ANSI/POSIX
-#endif
-
-struct Ureg
-{
-	unsigned long	status;
-	unsigned long	pc;
-	union{
-		unsigned long	sp;		/* r29 */
-		unsigned long	usp;		/* r29 */
-	};
-	unsigned long	cause;
-	unsigned long	badvaddr;
-	unsigned long	tlbvirt;
-	unsigned long	hi;
-	unsigned long	lo;
-	unsigned long	r31;
-	unsigned long	r30;
-	unsigned long	r28;
-	unsigned long	r27;		/* unused */
-	unsigned long	r26;		/* unused */
-	unsigned long	r25;
-	unsigned long	r24;
-	unsigned long	r23;
-	unsigned long	r22;
-	unsigned long	r21;
-	unsigned long	r20;
-	unsigned long	r19;
-	unsigned long	r18;
-	unsigned long	r17;
-	unsigned long	r16;
-	unsigned long	r15;
-	unsigned long	r14;
-	unsigned long	r13;
-	unsigned long	r12;
-	unsigned long	r11;
-	unsigned long	r10;
-	unsigned long	r9;
-	unsigned long	r8;
-	unsigned long	r7;
-	unsigned long	r6;
-	unsigned long	r5;
-	unsigned long	r4;
-	unsigned long	r3;
-	unsigned long	r2;
-	unsigned long	r1;
-};
-
-#endif

+ 0 - 62
mips/include/mips2ureg.h

@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-
-struct Ureg
-{
-	uint32_t	status;
-	long	pc;
-	union
-	{
-		struct
-		{
-			long	sp;	/* r29 */
-			uint32_t	cause;
-		};
-		struct
-		{
-			long	usp;	/* r29 */
-			uint32_t	ucause;
-		};
-	};
-	uint32_t	badvaddr;
-	uint32_t	tlbvirt;
-
-	long	hhi;	long	hi;
-	long	hlo;	long	lo;
-	long	hr31;	long	r31;
-	long	hr30;	long	r30;
-	long	hr28;	long	r28;
-	long	hr27;	long	r27;
-	long	hr26;	long	r26;
-	long	hr25;	long	r25;
-	long	hr24;	long	r24;
-	long	hr23;	long	r23;
-	long	hr22;	long	r22;
-	long	hr21;	long	r21;
-	long	hr20;	long	r20;
-	long	hr19;	long	r19;
-	long	hr18;	long	r18;
-	long	hr17;	long	r17;
-	long	hr16;	long	r16;
-	long	hr15;	long	r15;
-	long	hr14;	long	r14;
-	long	hr13;	long	r13;
-	long	hr12;	long	r12;
-	long	hr11;	long	r11;
-	long	hr10;	long	r10;
-	long	hr9;	long	r9;
-	long	hr8;	long	r8;
-	long	hr7;	long	r7;
-	long	hr6;	long	r6;
-	long	hr5;	long	r5;
-	long	hr4;	long	r4;
-	long	hr3;	long	r3;
-	long	hr2;	long	r2;
-	long	hr1;	long	r1;
-};

+ 0 - 78
mips/include/u.h

@@ -1,78 +0,0 @@
-/*
- * 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 short	ushort;
-typedef	unsigned char	uchar;
-typedef	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef unsigned long	uintptr;
-typedef unsigned long	usize;
-typedef	uint		Rune;
-typedef 	union FPdbleword FPdbleword;
-typedef long	jmp_buf[2];
-#define	JMPBUFSP	0
-#define	JMPBUFPC	1
-#define	JMPBUFDPC	0
-typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
-typedef unsigned char u8int;
-typedef unsigned short u16int;
-typedef unsigned int	u32int;
-typedef unsigned long long u64int;
-
-/* FCR (FCR31) */
-#define	FPINEX	(1<<7)		/* enables */
-#define	FPUNFL	(1<<8)
-#define	FPOVFL	(1<<9)
-#define	FPZDIV	(1<<10)
-#define	FPINVAL	(1<<11)
-#define	FPRNR	(0<<0)		/* rounding modes */
-#define	FPRZ	(1<<0)
-#define	FPRPINF	(2<<0)
-#define	FPRNINF	(3<<0)
-#define	FPRMASK	(3<<0)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-#define FPCOND	(1<<23)
-
-/* FSR (also FCR31) */
-#define	FPAINEX	(1<<2)		/* flags */
-#define	FPAOVFL	(1<<4)
-#define	FPAUNFL	(1<<3)
-#define	FPAZDIV	(1<<5)
-#define	FPAINVAL (1<<6)
-
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		uint32_t hi;
-		uint32_t lo;
-	};
-};
-
-/* stdarg */
-typedef	char*	va_list;
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)\
-	USED(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-1]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-1]:\
-		((list += sizeof(mode)), (mode*)list)[-1])

+ 0 - 53
mips/include/ureg.h

@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-
-struct Ureg
-{
-	uint32_t	status;
-	uint32_t	pc;
-	union{
-		uint32_t	sp;		/* r29 */
-		uint32_t	usp;		/* r29 */
-	};
-	uint32_t	cause;
-	uint32_t	badvaddr;
-	uint32_t	tlbvirt;
-	uint32_t	hi;
-	uint32_t	lo;
-	uint32_t	r31;
-	uint32_t	r30;
-	uint32_t	r28;
-	uint32_t	r27;		/* unused */
-	uint32_t	r26;		/* unused */
-	uint32_t	r25;
-	uint32_t	r24;
-	uint32_t	r23;
-	uint32_t	r22;
-	uint32_t	r21;
-	uint32_t	r20;
-	uint32_t	r19;
-	uint32_t	r18;
-	uint32_t	r17;
-	uint32_t	r16;
-	uint32_t	r15;
-	uint32_t	r14;
-	uint32_t	r13;
-	uint32_t	r12;
-	uint32_t	r11;
-	uint32_t	r10;
-	uint32_t	r9;
-	uint32_t	r8;
-	uint32_t	r7;
-	uint32_t	r6;
-	uint32_t	r5;
-	uint32_t	r4;
-	uint32_t	r3;
-	uint32_t	r2;
-	uint32_t	r1;
-};

+ 0 - 6
mips/mkfile

@@ -1,6 +0,0 @@
-</sys/src/mkfile.proto
-
-CC=vc
-LD=vl
-O=v
-AS=va

+ 0 - 82
power/include/ape/float.h

@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __FLOAT
-#define __FLOAT
-/* IEEE, default rounding */
-
-#define FLT_ROUNDS	1
-#define FLT_RADIX	2
-
-#define FLT_DIG		6
-#define FLT_EPSILON	1.19209290e-07
-#define FLT_MANT_DIG	24
-#define FLT_MAX		3.40282347e+38
-#define FLT_MAX_10_EXP	38
-#define FLT_MAX_EXP	128
-#define FLT_MIN		1.17549435e-38
-#define FLT_MIN_10_EXP	-37
-#define FLT_MIN_EXP	-125
-
-#define DBL_DIG		15
-#define DBL_EPSILON	2.2204460492503131e-16
-#define DBL_MANT_DIG	53
-#define DBL_MAX		1.797693134862315708145e+308
-#define DBL_MAX_10_EXP	308
-#define DBL_MAX_EXP	1024
-#define DBL_MIN		2.225073858507201383090233e-308
-#define DBL_MIN_10_EXP	-307
-#define DBL_MIN_EXP	-1021
-#define LDBL_MANT_DIG	DBL_MANT_DIG
-#define LDBL_EPSILON	DBL_EPSILON
-#define LDBL_DIG	DBL_DIG
-#define LDBL_MIN_EXP	DBL_MIN_EXP
-#define LDBL_MIN	DBL_MIN
-#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
-#define LDBL_MAX_EXP	DBL_MAX_EXP
-#define LDBL_MAX	DBL_MAX
-#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
-
-typedef 	union FPdbleword FPdbleword;
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		long hi;
-		long lo;
-	};
-};
-
-#ifdef _RESEARCH_SOURCE
-/* define stuff needed for floating conversion */
-#define IEEE_MC68k	1
-#define Sudden_Underflow 1
-#endif
-#ifdef _PLAN9_SOURCE
-/* FCR */
-#define	FPINEX	(1<<7)
-#define	FPOVFL	(1<<9)
-#define	FPUNFL	(1<<8)
-#define	FPZDIV	(1<<10)
-#define	FPRNR	(0<<0)
-#define	FPRZ	(1<<0)
-#define	FPRPINF	(2<<0)
-#define	FPRNINF	(3<<0)
-#define	FPRMASK	(3<<0)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-/* FSR */
-#define	FPAINEX	(1<<2)
-#define	FPAOVFL	(1<<4)
-#define	FPAUNFL	(1<<3)
-#define	FPAZDIV	(1<<5)
-#endif
-#endif /* __FLOAT */

+ 0 - 87
power/include/ape/math.h

@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __MATH
-#define __MATH
-#pragma lib "/$M/lib/ape/libap.a"
-
-/* a HUGE_VAL appropriate for IEEE double-precision */
-/* the correct value, 1.797693134862316e+308, causes a ken overflow */
-#define HUGE_VAL 1.79769313486231e+308
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern double acos(double);
-extern double asin(double);
-extern double atan(double);
-extern double atan2(double, double);
-extern double cos(double);
-extern double hypot(double, double);
-extern double sin(double);
-extern double tan(double);
-extern double cosh(double);
-extern double sinh(double);
-extern double tanh(double);
-extern double exp(double);
-extern double frexp(double, int *);
-extern double ldexp(double, int);
-extern double log(double);
-extern double log10(double);
-extern double modf(double, double *);
-extern double pow(double, double);
-extern double sqrt(double);
-extern double ceil(double);
-extern double fabs(double);
-extern double floor(double);
-extern double fmod(double, double);
-extern double NaN(void);
-extern int isNaN(double);
-extern double Inf(int);
-extern int isInf(double, int);
-
-#ifdef _RESEARCH_SOURCE
-/* does >> treat left operand as unsigned ? */
-#define Unsigned_Shifts 1
-#define	M_E		2.7182818284590452354	/* e */
-#define	M_LOG2E		1.4426950408889634074	/* log 2e */
-#define	M_LOG10E	0.43429448190325182765	/* log 10e */
-#define	M_LN2		0.69314718055994530942	/* log e2 */
-#define	M_LN10		2.30258509299404568402	/* log e10 */
-#define	M_PI		3.14159265358979323846	/* pi */
-#define	M_PI_2		1.57079632679489661923	/* pi/2 */
-#define	M_PI_4		0.78539816339744830962	/* pi/4 */
-#define	M_1_PI		0.31830988618379067154	/* 1/pi */
-#define	M_2_PI		0.63661977236758134308	/* 2/pi */
-#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
-#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
-#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
-
-extern double hypot(double, double);
-extern double erf(double);
-extern double erfc(double);
-extern double j0(double);
-extern double y0(double);
-extern double j1(double);
-extern double y1(double);
-extern double jn(int, double);
-extern double yn(int, double);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#define isnan(x) isNaN(x)
-#define isinf(x) isInf(x, 0)
-
-#endif /* __MATH */

+ 0 - 27
power/include/ape/stdarg.h

@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __STDARG
-#define __STDARG
-
-typedef char *va_list;
-
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) <= 4)?\
-		((list += 4), (mode*)list)[-1]:\
-	(signof(mode) != signof(double))?\
-		((list += sizeof(mode)), (mode*)list)[-1]:\
-		((list = (char*)((unsigned long)(list+7) & ~7) + sizeof(mode)), (mode*)list)[-1])
-
-#endif /* __STDARG */

+ 0 - 59
power/include/ape/ureg.h

@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __UREG_H
-#define __UREG_H
-#if !defined(_PLAN9_SOURCE)
-    This header file is an extension to ANSI/POSIX
-#endif
-
-struct Ureg
-{	unsigned long	cause;
-	union { unsigned long	srr1; unsigned long status;};
-	unsigned long	pc;	/* SRR0 */
-	unsigned long	pad;
-	unsigned long	lr;
-	unsigned long	cr;
-	unsigned long	xer;
-	unsigned long	ctr;
-	unsigned long	r0;
-	union{ unsigned long r1;	unsigned long	sp;	unsigned long	usp; };
-	unsigned long	r2;
-	unsigned long	r3;
-	unsigned long	r4;
-	unsigned long	r5;
-	unsigned long	r6;
-	unsigned long	r7;
-	unsigned long	r8;
-	unsigned long	r9;
-	unsigned long	r10;
-	unsigned long	r11;
-	unsigned long	r12;
-	unsigned long	r13;
-	unsigned long	r14;
-	unsigned long	r15;
-	unsigned long	r16;
-	unsigned long	r17;
-	unsigned long	r18;
-	unsigned long	r19;
-	unsigned long	r20;
-	unsigned long	r21;
-	unsigned long	r22;
-	unsigned long	r23;
-	unsigned long	r24;
-	unsigned long	r25;
-	unsigned long	r26;
-	unsigned long	r27;
-	unsigned long	r28;
-	unsigned long	r29;
-	unsigned long	r30;
-	unsigned long	r31;
-};
-
-#endif

+ 0 - 94
power/include/u.h

@@ -1,94 +0,0 @@
-/*
- * 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 short	ushort;
-typedef	unsigned char	uchar;
-typedef	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	  signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef unsigned long	uintptr;
-typedef unsigned long	usize;
-typedef	uint		Rune;
-typedef union FPdbleword FPdbleword;
-typedef long		jmp_buf[2];
-#define	JMPBUFSP	0
-#define	JMPBUFPC	1
-#define	JMPBUFDPC	0
-typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
-typedef unsigned char	u8int;
-typedef unsigned short	u16int;
-typedef unsigned int	u32int;
-typedef unsigned long long u64int;
-
-/* FPSCR */
-#define	FPSFX	(1<<31)	/* exception summary (sticky) */
-#define	FPSEX	(1<<30)	/* enabled exception summary */
-#define	FPSVX	(1<<29)	/* invalid operation exception summary */
-#define	FPSOX	(1<<28)	/* overflow exception OX (sticky) */
-#define	FPSUX	(1<<27)	/* underflow exception UX (sticky) */
-#define	FPSZX	(1<<26)	/* zero divide exception ZX (sticky) */
-#define	FPSXX	(1<<25)	/* inexact exception XX (sticky) */
-#define	FPSVXSNAN (1<<24)	/* invalid operation exception for SNaN (sticky) */
-#define	FPSVXISI (1<<23)	/* invalid operation exception for ∞-∞ (sticky) */
-#define	FPSVXIDI (1<<22)	/* invalid operation exception for ∞/∞ (sticky) */
-#define	FPSVXZDZ (1<<21)	/* invalid operation exception for 0/0 (sticky) */
-#define	FPSVXIMZ (1<<20)	/* invalid operation exception for ∞*0 (sticky) */
-#define	FPSVXVC	(1<<19)	/* invalid operation exception for invalid compare (sticky) */
-#define	FPSFR	(1<<18)	/* fraction rounded */
-#define	FPSFI	(1<<17)	/* fraction inexact */
-#define	FPSFPRF	(1<<16)	/* floating point result class */
-#define	FPSFPCC	(0xF<<12)	/* <, >, =, unordered */
-#define	FPVXCVI	(1<<8)	/* enable exception for invalid integer convert (sticky) */
-#define	FPVE	(1<<7)	/* invalid operation exception enable */
-#define	FPOVFL	(1<<6)	/* enable overflow exceptions */
-#define	FPUNFL	(1<<5)	/* enable underflow */
-#define	FPZDIV	(1<<4)	/* enable zero divide */
-#define	FPINEX	(1<<3)	/* enable inexact exceptions */
-#define	FPRMASK	(3<<0)	/* rounding mode */
-#define	FPRNR	(0<<0)
-#define	FPRZ	(1<<0)
-#define	FPRPINF	(2<<0)
-#define	FPRNINF	(3<<0)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-#define	FPINVAL	FPVE
-
-#define	FPAOVFL	FPSOX
-#define	FPAINEX	FPSXX
-#define	FPAUNFL	FPSUX
-#define	FPAZDIV	FPSZX
-#define	FPAINVAL	FPSVX
-
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		uint32_t hi;
-		uint32_t lo;
-	};
-};
-
-typedef	char*	va_list;
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)\
-	USED(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) <= 4)?\
-		((list += 4), (mode*)list)[-1]:\
-	(signof(mode) != signof(double))?\
-		((list += sizeof(mode)), (mode*)list)[-1]:\
-		((list = (char*)((uintptr)(list+7) & ~7) + sizeof(mode)), (mode*)list)[-1])

+ 0 - 60
power/include/ureg.h

@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-
-struct Ureg
-{
-/*  0*/	uint32_t	cause;
-/*  4*/	union { uint32_t	srr1; uint32_t status;};
-/*  8*/	uint32_t	pc;	/* SRR0 */
-/* 12*/	uint32_t	pad;
-/* 16*/	uint32_t	lr;
-/* 20*/	uint32_t	cr;
-/* 24*/	uint32_t	xer;
-/* 28*/	uint32_t	ctr;
-/* 32*/	uint32_t	r0;
-/* 36*/	union{ uint32_t r1;	uint32_t	sp;	uint32_t	usp; };
-/* 40*/	uint32_t	r2;
-/* 44*/	uint32_t	r3;
-/* 48*/	uint32_t	r4;
-/* 52*/	uint32_t	r5;
-/* 56*/	uint32_t	r6;
-/* 60*/	uint32_t	r7;
-/* 64*/	uint32_t	r8;
-/* 68*/	uint32_t	r9;
-/* 72*/	uint32_t	r10;
-/* 76*/	uint32_t	r11;
-/* 80*/	uint32_t	r12;
-/* 84*/	uint32_t	r13;
-/* 88*/	uint32_t	r14;
-/* 92*/	uint32_t	r15;
-/* 96*/	uint32_t	r16;
-/*100*/	uint32_t	r17;
-/*104*/	uint32_t	r18;
-/*108*/	uint32_t	r19;
-/*112*/	uint32_t	r20;
-/*116*/	uint32_t	r21;
-/*120*/	uint32_t	r22;
-/*124*/	uint32_t	r23;
-/*128*/	uint32_t	r24;
-/*132*/	uint32_t	r25;
-/*136*/	uint32_t	r26;
-/*140*/	uint32_t	r27;
-/*144*/	uint32_t	r28;
-/*148*/	uint32_t	r29;
-/*152*/	uint32_t	r30;
-/*156*/	uint32_t	r31;
-/*160*/	uint32_t	dcmp;
-/*164*/	uint32_t	icmp;
-/*168*/	uint32_t	dmiss;
-/*172*/	uint32_t	imiss;
-/*176*/	uint32_t	hash1;
-/*180*/	uint32_t	hash2;
-/*184*/	uint32_t	dar;
-/*188*/	uint32_t	dsisr;
-};

+ 0 - 6
power/mkfile

@@ -1,6 +0,0 @@
-</sys/src/mkfile.proto
-
-CC=qc
-LD=ql
-O=q
-AS=qa

+ 0 - 96
power64/include/u.h

@@ -1,96 +0,0 @@
-/*
- * 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 short	ushort;
-typedef	unsigned char	uchar;
-typedef	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef unsigned long long uintptr;
-typedef unsigned long	usize;
-typedef	uint		Rune;
-typedef 	union FPdbleword FPdbleword;
-typedef uintptr	jmp_buf[2];
-#define	JMPBUFSP	0
-#define	JMPBUFPC	1
-#define	JMPBUFDPC	0
-typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
-typedef unsigned char u8int;
-typedef unsigned short u16int;
-typedef unsigned int	u32int;
-typedef unsigned long long u64int;
-
-/* FPSCR */
-#define	FPSFX	(1<<31)	/* exception summary (sticky) */
-#define	FPSEX	(1<<30)	/* enabled exception summary */
-#define	FPSVX	(1<<29)	/* invalid operation exception summary */
-#define	FPSOX	(1<<28)	/* overflow exception OX (sticky) */
-#define	FPSUX	(1<<27)	/* underflow exception UX (sticky) */
-#define	FPSZX	(1<<26)	/* zero divide exception ZX (sticky) */
-#define	FPSXX	(1<<25)	/* inexact exception XX (sticky) */
-#define	FPSVXSNAN (1<<24)	/* invalid operation exception for SNaN (sticky) */
-#define	FPSVXISI	(1<<23)	/* invalid operation exception for ∞-∞ (sticky) */
-#define	FPSVXIDI	(1<<22)	/* invalid operation exception for ∞/∞ (sticky) */
-#define	FPSVXZDZ (1<<21)	/* invalid operation exception for 0/0 (sticky) */
-#define	FPSVXIMZ	(1<<20)	/* invalid operation exception for ∞*0 (sticky) */
-#define	FPSVXVC	(1<<19)	/* invalid operation exception for invalid compare (sticky) */
-#define	FPSFR	(1<<18)	/* fraction rounded */
-#define	FPSFI	(1<<17)	/* fraction inexact */
-#define	FPSFPRF	(1<<16)	/* floating point result class */
-#define	FPSFPCC	(0xF<<12)	/* <, >, =, unordered */
-#define	FPVXCVI	(1<<8)	/* enable exception for invalid integer convert (sticky) */
-#define	FPVE	(1<<7)	/* invalid operation exception enable */
-#define	FPOVFL	(1<<6)	/* enable overflow exceptions */
-#define	FPUNFL	(1<<5)	/* enable underflow */
-#define	FPZDIV	(1<<4)	/* enable zero divide */
-#define	FPINEX	(1<<3)	/* enable inexact exceptions */
-#define	FPRMASK	(3<<0)	/* rounding mode */
-#define	FPRNR	(0<<0)
-#define	FPRZ	(1<<0)
-#define	FPRPINF	(2<<0)
-#define	FPRNINF	(3<<0)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-#define	FPINVAL	FPVE
-
-#define	FPAOVFL	FPSOX
-#define	FPAINEX	FPSXX
-#define	FPAUNFL	FPSUX
-#define	FPAZDIV	FPSZX
-#define	FPAINVAL	FPSVX
-
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		uint32_t hi;
-		uint32_t lo;
-	};
-};
-
-typedef	char*	va_list;
-#define va_start(list, start) list =\
-	(sizeof(start) < 8?\
-		(char*)((vlong*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)\
-	USED(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((mode*)(list += 8))[-1]:\
-	(sizeof(mode) == 2)?\
-		((mode*)(list += 8))[-1]:\
-	(sizeof(mode) == 4)?\
-		((mode*)(list += 8))[-1]:\
-		((mode*)(list += sizeof(mode)))[-1])

+ 0 - 53
power64/include/ureg.h

@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-
-struct Ureg
-{
-/*  0*/	u64int	cause;	/* trap or interrupt vector */
-/*  8*/	u64int	msr; /* SRR1 */
-/* 16*/	u64int	pc;	/* SRR0 */
-/* 24*/	u64int	unused;
-/* 32*/	u64int	lr;
-/* 36*/	u32int	pad;
-/* 40*/	u32int	cr;
-/* 48*/	u64int	xer;
-/* 56*/	u64int	ctr;
-/* 64*/	u64int	r0;
-/* 72*/	union{ u64int r1;	u64int	sp;	u64int	usp; };
-/* 80*/	u64int	r2;
-/* 88*/	u64int	r3;
-/* 96*/	u64int	r4;
-/*104*/	u64int	r5;
-/*112*/	u64int	r6;
-/*120*/	u64int	r7;
-/*128*/	u64int	r8;
-/*136*/	u64int	r9;
-/*144*/	u64int	r10;
-/*152*/	u64int	r11;
-/*160*/	u64int	r12;
-/*168*/	u64int	r13;
-/*176*/	u64int	r14;
-/*184*/	u64int	r15;
-/*192*/	u64int	r16;
-/*200*/	u64int	r17;
-/*208*/	u64int	r18;
-/*216*/	u64int	r19;
-/*224*/	u64int	r20;
-/*232*/	u64int	r21;
-/*240*/	u64int	r22;
-/*248*/	u64int	r23;
-/*256*/	u64int	r24;
-/*264*/	u64int	r25;
-/*272*/	u64int	r26;
-/*280*/	u64int	r27;
-/*288*/	u64int	r28;
-/*296*/	u64int	r29;
-/*304*/	u64int	r30;
-/*312*/	u64int	r31;
-};

+ 0 - 6
power64/mkfile

@@ -1,6 +0,0 @@
-</sys/src/mkfile.proto
-
-CC=9c
-LD=9l
-O=9
-AS=9a

+ 0 - 82
sparc/include/ape/float.h

@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __FLOAT
-#define __FLOAT
-/* IEEE, default rounding */
-
-#define FLT_ROUNDS	1
-#define FLT_RADIX	2
-
-#define FLT_DIG		6
-#define FLT_EPSILON	1.19209290e-07
-#define FLT_MANT_DIG	24
-#define FLT_MAX		3.40282347e+38
-#define FLT_MAX_10_EXP	38
-#define FLT_MAX_EXP	128
-#define FLT_MIN		1.17549435e-38
-#define FLT_MIN_10_EXP	-37
-#define FLT_MIN_EXP	-125
-
-#define DBL_DIG		15
-#define DBL_EPSILON	2.2204460492503131e-16
-#define DBL_MANT_DIG	53
-#define DBL_MAX		1.797693134862315708145e+308
-#define DBL_MAX_10_EXP	308
-#define DBL_MAX_EXP	1024
-#define DBL_MIN		2.225073858507201383090233e-308
-#define DBL_MIN_10_EXP	-307
-#define DBL_MIN_EXP	-1021
-#define LDBL_MANT_DIG	DBL_MANT_DIG
-#define LDBL_EPSILON	DBL_EPSILON
-#define LDBL_DIG	DBL_DIG
-#define LDBL_MIN_EXP	DBL_MIN_EXP
-#define LDBL_MIN	DBL_MIN
-#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
-#define LDBL_MAX_EXP	DBL_MAX_EXP
-#define LDBL_MAX	DBL_MAX
-#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP
-
-typedef 	union FPdbleword FPdbleword;
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		long hi;
-		long lo;
-	};
-};
-
-#ifdef _RESEARCH_SOURCE
-/* define order of longs in IEEE double: little endian */
-#define IEEE_MC68k	1
-#define Sudden_Underflow 1
-#endif
-#ifdef _PLAN9_SOURCE
-/* FCR */
-#define	FPINEX	(1<<23)
-#define	FPOVFL	(1<<26)
-#define	FPUNFL	(1<<25)
-#define	FPZDIV	(1<<24)
-#define	FPRNR	(0<<30)
-#define	FPRZ	(1<<30)
-#define	FPRPINF	(2<<30)
-#define	FPRNINF	(3<<30)
-#define	FPRMASK	(3<<30)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-/* FSR */
-#define	FPAINEX	(1<<5)
-#define	FPAOVFL	(1<<8)
-#define	FPAUNFL	(1<<7)
-#define	FPAZDIV	(1<<6)
-#endif
-#endif /* __FLOAT */

+ 0 - 87
sparc/include/ape/math.h

@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __MATH
-#define __MATH
-#pragma lib "/$M/lib/ape/libap.a"
-
-/* a HUGE_VAL appropriate for IEEE double-precision */
-/* the correct value, 1.797693134862316e+308, causes a ken overflow */
-#define HUGE_VAL 1.79769313486231e+308
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern double acos(double);
-extern double asin(double);
-extern double atan(double);
-extern double atan2(double, double);
-extern double cos(double);
-extern double hypot(double, double);
-extern double sin(double);
-extern double tan(double);
-extern double cosh(double);
-extern double sinh(double);
-extern double tanh(double);
-extern double exp(double);
-extern double frexp(double, int *);
-extern double ldexp(double, int);
-extern double log(double);
-extern double log10(double);
-extern double modf(double, double *);
-extern double pow(double, double);
-extern double sqrt(double);
-extern double ceil(double);
-extern double fabs(double);
-extern double floor(double);
-extern double fmod(double, double);
-extern double NaN(void);
-extern int isNaN(double);
-extern double Inf(int);
-extern int isInf(double, int);
-
-#ifdef _RESEARCH_SOURCE
-/* does >> treat left operand as unsigned ? */
-#define Unsigned_Shifts 1
-#define	M_E		2.7182818284590452354	/* e */
-#define	M_LOG2E		1.4426950408889634074	/* log 2e */
-#define	M_LOG10E	0.43429448190325182765	/* log 10e */
-#define	M_LN2		0.69314718055994530942	/* log e2 */
-#define	M_LN10		2.30258509299404568402	/* log e10 */
-#define	M_PI		3.14159265358979323846	/* pi */
-#define	M_PI_2		1.57079632679489661923	/* pi/2 */
-#define	M_PI_4		0.78539816339744830962	/* pi/4 */
-#define	M_1_PI		0.31830988618379067154	/* 1/pi */
-#define	M_2_PI		0.63661977236758134308	/* 2/pi */
-#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
-#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
-#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
-
-extern double hypot(double, double);
-extern double erf(double);
-extern double erfc(double);
-extern double j0(double);
-extern double y0(double);
-extern double j1(double);
-extern double y1(double);
-extern double jn(int, double);
-extern double yn(int, double);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#define isnan(x) isNaN(x)
-#define isinf(x) isInf(x, 0)
-
-#endif /* __MATH */

+ 0 - 27
sparc/include/ape/stdarg.h

@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __STDARG
-#define __STDARG
-
-typedef char *va_list;
-
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-1]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-1]:\
-		((list += sizeof(mode)), (mode*)list)[-1])
-
-#endif /* __STDARG */

+ 0 - 62
sparc/include/ape/ureg.h

@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __UREG_H
-#define __UREG_H
-#if !defined(_PLAN9_SOURCE)
-    This header file is an extension to ANSI/POSIX
-#endif
-
-struct Ureg
-{
-	unsigned long	r0;			/* unnecessary; just for symmetry */
-	union{
-		unsigned long	sp;		/* r1 */
-		unsigned long	usp;		/* r1 */
-		unsigned long	r1;
-	};
-	unsigned long	r2;
-	unsigned long	r3;
-	unsigned long	r4;
-	unsigned long	r5;
-	unsigned long	r6;
-	unsigned long	r7;
-	unsigned long	r8;
-	unsigned long	r9;
-	unsigned long	r10;
-	unsigned long	r11;
-	unsigned long	r12;
-	unsigned long	r13;
-	unsigned long	r14;
-	unsigned long	r15;
-	unsigned long	r16;
-	unsigned long	r17;
-	unsigned long	r18;
-	unsigned long	r19;
-	unsigned long	r20;
-	unsigned long	r21;
-	unsigned long	r22;
-	unsigned long	r23;
-	unsigned long	r24;
-	unsigned long	r25;
-	unsigned long	r26;
-	unsigned long	r27;
-	unsigned long	r28;
-	unsigned long	r29;
-	unsigned long	r30;
-	unsigned long	r31;
-	unsigned long	y;
-	unsigned long	tbr;
-	unsigned long	psr;
-	unsigned long	npc;
-	unsigned long	pc;
-	unsigned long	pad;	/* so structure is double word aligned */
-};
-
-#endif

+ 0 - 74
sparc/include/u.h

@@ -1,74 +0,0 @@
-/*
- * 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 short	ushort;
-typedef	unsigned char	uchar;
-typedef	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef unsigned long	uintptr;
-typedef unsigned long	usize;
-typedef	uint		Rune;
-typedef 	union FPdbleword FPdbleword;
-typedef long	jmp_buf[2];
-#define	JMPBUFSP	0
-#define	JMPBUFPC	1
-#define	JMPBUFDPC	(-8)
-typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
-typedef unsigned char u8int;
-typedef unsigned short u16int;
-typedef unsigned int	u32int;
-typedef unsigned long long u64int;
-
-/* FCR */
-#define	FPINEX	(1<<23)
-#define	FPOVFL	(1<<26)
-#define	FPUNFL	(1<<25)
-#define	FPZDIV	(1<<24)
-#define	FPRNR	(0<<30)
-#define	FPRZ	(1<<30)
-#define	FPINVAL	(1<<27)
-#define	FPRPINF	(2<<30)
-#define	FPRNINF	(3<<30)
-#define	FPRMASK	(3<<30)
-#define	FPPEXT	0
-#define	FPPSGL	0
-#define	FPPDBL	0
-#define	FPPMASK	0
-/* FSR */
-#define	FPAINEX	(1<<5)
-#define	FPAZDIV	(1<<6)
-#define	FPAUNFL	(1<<7)
-#define	FPAOVFL	(1<<8)
-#define	FPAINVAL	(1<<9)
-union FPdbleword
-{
-	double	x;
-	struct {	/* big endian */
-		uint32_t hi;
-		uint32_t lo;
-	};
-};
-
-typedef	char*	va_list;
-#define va_start(list, start) list =\
-	(sizeof(start) < 4?\
-		(char*)((int*)&(start)+1):\
-		(char*)(&(start)+1))
-#define va_end(list)\
-	USED(list)
-#define va_arg(list, mode)\
-	((sizeof(mode) == 1)?\
-		((list += 4), (mode*)list)[-1]:\
-	(sizeof(mode) == 2)?\
-		((list += 4), (mode*)list)[-1]:\
-		((list += sizeof(mode)), (mode*)list)[-1])

+ 0 - 54
sparc/include/ureg.h

@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-struct Ureg
-{
-	uint32_t	r0;			/* unnecessary; just for symmetry */
-	union{
-		uint32_t	sp;		/* r1 */
-		uint32_t	usp;		/* r1 */
-		uint32_t	r1;
-	};
-	uint32_t	r2;
-	uint32_t	r3;
-	uint32_t	r4;
-	uint32_t	r5;
-	uint32_t	r6;
-	uint32_t	r7;
-	uint32_t	r8;
-	uint32_t	r9;
-	uint32_t	r10;
-	uint32_t	r11;
-	uint32_t	r12;
-	uint32_t	r13;
-	uint32_t	r14;
-	uint32_t	r15;
-	uint32_t	r16;
-	uint32_t	r17;
-	uint32_t	r18;
-	uint32_t	r19;
-	uint32_t	r20;
-	uint32_t	r21;
-	uint32_t	r22;
-	uint32_t	r23;
-	uint32_t	r24;
-	uint32_t	r25;
-	uint32_t	r26;
-	uint32_t	r27;
-	uint32_t	r28;
-	uint32_t	r29;
-	uint32_t	r30;
-	uint32_t	r31;
-	uint32_t	y;
-	uint32_t	tbr;
-	uint32_t	psr;
-	uint32_t	npc;
-	uint32_t	pc;
-	uint32_t	pad;	/* so structure is double word aligned */
-};

+ 0 - 7
sparc/mkfile

@@ -1,7 +0,0 @@
-</sys/src/mkfile.proto
-
-CC=kc
-LD=kl
-O=k
-RL=rl
-AS=ka

+ 96 - 110
sys/include/libc.h

@@ -64,30 +64,30 @@ enum
 /*
  * rune routines
  */
-extern	int	runetochar(char*, Rune*);
-extern	int	chartorune(Rune*, char*);
-extern	int	runelen(int32_t);
-extern	int	runenlen(Rune*, int);
-extern	int	fullrune(char*, int);
-extern	int	utflen(char*);
-extern	int	utfnlen(char*, int32_t);
-extern	char*	utfrune(char*, int32_t);
-extern	char*	utfrrune(char*, int32_t);
-extern	char*	utfutf(char*, char*);
-extern	char*	utfecpy(char*, char*, char*);
-
-extern	Rune*	runestrcat(Rune*, Rune*);
-extern	Rune*	runestrchr(Rune*, Rune);
-extern	int	runestrcmp(Rune*, Rune*);
-extern	Rune*	runestrcpy(Rune*, Rune*);
-extern	Rune*	runestrncpy(Rune*, Rune*, int32_t);
-extern	Rune*	runestrecpy(Rune*, Rune*, Rune*);
-extern	Rune*	runestrdup(Rune*);
-extern	Rune*	runestrncat(Rune*, Rune*, int32_t);
-extern	int	runestrncmp(Rune*, Rune*, int32_t);
-extern	Rune*	runestrrchr(Rune*, Rune);
-extern	int32_t	runestrlen(Rune*);
-extern	Rune*	runestrstr(Rune*, Rune*);
+extern	int	runetochar(char*, const Rune*);
+extern	int	chartorune(Rune*, const char*);
+extern	int	runelen(Rune);
+extern	int	runenlen(const Rune*, int);
+extern	int	fullrune(const char*, int);
+extern	int	utflen(const char*);
+extern	int	utfnlen(const char*, int32_t);
+extern	char*	utfrune(const char*, Rune);
+extern	char*	utfrrune(const char*, Rune);
+extern	char*	utfutf(const char*, const char*);
+extern	char*	utfecpy(char*, char *, const char*);
+
+extern	Rune*	runestrcat(Rune*, const Rune*);
+extern	Rune*	runestrchr(const Rune*, Rune);
+extern	int	runestrcmp(const Rune*, const Rune*);
+extern	Rune*	runestrcpy(Rune*, const Rune*);
+extern	Rune*	runestrncpy(Rune*, const Rune*, int32_t);
+extern	Rune*	runestrecpy(Rune*, Rune*, const Rune*);
+extern	Rune*	runestrdup(const Rune*);
+extern	Rune*	runestrncat(Rune*, const Rune*, int32_t);
+extern	int	runestrncmp(const Rune*, const Rune*, int32_t);
+extern	Rune*	runestrrchr(const Rune*, Rune);
+extern	int32_t	runestrlen(const Rune*);
+extern	Rune*	runestrstr(const Rune*, const Rune*);
 
 extern	Rune	tolowerrune(Rune);
 extern	Rune	totitlerune(Rune);
@@ -154,24 +154,24 @@ enum{
 	FmtFlag		= FmtByte << 1
 };
 
-extern	int	print(char*, ...);
-extern	char*	seprint(char*, char*, char*, ...);
-extern	char*	vseprint(char*, char*, char*, va_list);
-extern	int	snprint(char*, int, char*, ...);
-extern	int	vsnprint(char*, int, char*, va_list);
-extern	char*	smprint(char*, ...);
-extern	char*	vsmprint(char*, va_list);
-extern	int	sprint(char*, char*, ...);
-extern	int	fprint(int, char*, ...);
-extern	int	vfprint(int, char*, va_list);
-
-extern	int	runesprint(Rune*, char*, ...);
-extern	int	runesnprint(Rune*, int, char*, ...);
-extern	int	runevsnprint(Rune*, int, char*, va_list);
-extern	Rune*	runeseprint(Rune*, Rune*, char*, ...);
-extern	Rune*	runevseprint(Rune*, Rune*, char*, va_list);
-extern	Rune*	runesmprint(char*, ...);
-extern	Rune*	runevsmprint(char*, va_list);
+extern	int	print(const char*, ...);
+extern	char*	seprint(char*, char*, const char*, ...);
+extern	char*	vseprint(char*, char*, const char*, va_list);
+extern	int	snprint(char*, int, const char*, ...);
+extern	int	vsnprint(char*, int, const char*, va_list);
+extern	char*	smprint(const char*, ...);
+extern	char*	vsmprint(const char*, va_list);
+extern	int	sprint(char*, const char*, ...);
+extern	int	fprint(int, const char*, ...);
+extern	int	vfprint(int, const char*, va_list);
+
+extern	int	runesprint(Rune*, const char*, ...);
+extern	int	runesnprint(Rune*, int, const char*, ...);
+extern	int	runevsnprint(Rune*, int, const char*, va_list);
+extern	Rune*	runeseprint(Rune*, Rune*, const char*, ...);
+extern	Rune*	runevseprint(Rune*, Rune*, const char*, va_list);
+extern	Rune*	runesmprint(const char*, ...);
+extern	Rune*	runevsmprint(const char*, va_list);
 
 extern	int	fmtfdinit(Fmt*, int, char*, int);
 extern	int	fmtfdflush(Fmt*);
@@ -183,13 +183,13 @@ extern	Rune*	runefmtstrflush(Fmt*);
 
 
 extern	int	fmtinstall(int, int (*)(Fmt*));
-extern	int	dofmt(Fmt*, char*);
-extern	int	dorfmt(Fmt*, Rune*);
-extern	int	fmtprint(Fmt*, char*, ...);
-extern	int	fmtvprint(Fmt*, char*, va_list);
+extern	int	dofmt(Fmt*, const char*);
+extern	int	dorfmt(Fmt*, const Rune*);
+extern	int	fmtprint(Fmt*, const char*, ...);
+extern	int	fmtvprint(Fmt*, const char*, va_list);
 extern	int	fmtrune(Fmt*, int);
-extern	int	fmtstrcpy(Fmt*, char*);
-extern	int	fmtrunestrcpy(Fmt*, Rune*);
+extern	int	fmtstrcpy(Fmt*, const char*);
+extern	int	fmtrunestrcpy(Fmt*, const Rune*);
 /*
  * error string for %r
  * supplied on per os basis, not part of fmt library
@@ -199,10 +199,10 @@ extern	int	errfmt(Fmt *f);
 /*
  * quoted strings
  */
-extern	char	*unquotestrdup(char*);
-extern	Rune	*unquoterunestrdup(Rune*);
-extern	char	*quotestrdup(char*);
-extern	Rune	*quoterunestrdup(Rune*);
+extern	char	*unquotestrdup(const char*);
+extern	Rune	*unquoterunestrdup(const Rune*);
+extern	char	*quotestrdup(const char*);
+extern	Rune	*quoterunestrdup(const Rune*);
 extern	int	quotestrfmt(Fmt*);
 extern	int	quoterunestrfmt(Fmt*);
 extern	void	quotefmtinstall(void);
@@ -299,27 +299,27 @@ enum
 	PNGROUP		= 2,
 };
 
-extern	void	_assert(char*);
+extern	void	_assert(const char*);
 extern	int	abs(int);
 extern	int	atexit(void(*)(void));
 extern	void	atexitdont(void(*)(void));
 extern	int	atnotify(int(*)(void*, char*), int);
-extern	double	atof(char*);
-extern	int	atoi(char*);
-extern	int32_t	atol(char*);
-extern	int64_t	atoll(char*);
+extern	double	atof(const char*);
+extern	int	atoi(const char*);
+extern	int32_t	atol(const char*);
+extern	int64_t	atoll(const char*);
 extern	double	charstod(int(*)(void*), void*);
 extern	char*	cleanname(char*);
 extern	int	decrypt(void*, void*, int);
 extern	int	encrypt(void*, void*, int);
-extern	int	dec64(uint8_t*, int, char*, int);
-extern	int	enc64(char*, int, uint8_t*, int);
-extern	int	dec32(uint8_t*, int, char*, int);
-extern	int	enc32(char*, int, uint8_t*, int);
-extern	int	dec16(uint8_t*, int, char*, int);
-extern	int	enc16(char*, int, uint8_t*, int);
+extern	int	dec64(uint8_t*, int, const char*, int);
+extern	int	enc64(char*, int, const uint8_t*, int);
+extern	int	dec32(uint8_t*, int, const char*, int);
+extern	int	enc32(char*, int, const uint8_t*, int);
+extern	int	dec16(uint8_t*, int, const char*, int);
+extern	int	enc16(char*, int, const uint8_t*, int);
 extern	int	encodefmt(Fmt*);
-extern	void	exits(char*);
+extern	void	exits(const char*);
 extern	double	frexp(double, int*);
 extern	void	getcallstack(uintptr *, size_t);
 extern	char*	getenv(const char*);
@@ -333,12 +333,11 @@ extern	double	ldexp(double, int);
 extern	void	longjmp(jmp_buf, int);
 extern	char*	mktemp(char*);
 extern	double	modf(double, double*);
-extern	int	netcrypt(void*, void*);
 extern	void	notejmp(void*, jmp_buf, int);
 extern	void	perror(const char*);
-extern	int	postnote(int, int, char *);
+extern	int	postnote(int, int, const char *);
 extern	double	pow10(int);
-extern	int	putenv(char*, char*);
+extern	int	putenv(const char*, const char*);
 extern	void	qsort(void*, int32_t, int32_t,
 				int (*)(const void*, const void*));
 extern	int	setjmp(jmp_buf) __attribute__((returns_twice));;
@@ -353,18 +352,6 @@ extern	int32_t	time(int32_t*);
 extern	int	tolower(int);
 extern	int	toupper(int);
 
-/*
- *  profiling
- */
-enum {
-	Profoff,		/* No profiling */
-	Profuser,		/* Measure user time only (default) */
-	Profkernel,		/* Measure user + kernel time */
-	Proftime,		/* Measure total time */
-	Profsample,		/* Use clock interrupt to sample (default when there is no cycle counter) */
-}; /* what */
-extern	void	prof(void (*fn)(void*), void *arg, int entries, int what);
-
 /*
  * atomic
  */
@@ -447,20 +434,20 @@ extern	void	privfree(void**);
  *  network dialing
  */
 #define NETPATHLEN 40
-extern	int	accept(int, char*);
-extern	int	announce(char*, char*);
-extern	int	dial(char*, char*, char*, int*);
-extern	void	setnetmtpt(char*, int, char*);
+extern	int	accept(int, const char*);
+extern	int	announce(const char*, char*);
+extern	int	dial(const char*, const char*, char*, int*);
+extern	void	setnetmtpt(char*, int, const char*);
 extern	int	hangup(int);
-extern	int	listen(char*, char*);
-extern	char*	netmkaddr(char*, char*, char*);
-extern	int	reject(int, char*, char*);
+extern	int	listen(const char*, char*);
+extern	char*	netmkaddr(const char*, const char*, const char*);
+extern	int	reject(int, const char*, const char*);
 
 /*
  *  encryption
  */
-extern	int	pushssl(int, char*, char*, char*, int*);
-extern	int	pushtls(int, char*, char*, int, char*,
+extern	int	pushssl(int, const char*, const char*, const char*, int*);
+extern	int	pushtls(int, const char*, const char*, int, const char*,
 				 char*);
 
 /*
@@ -479,7 +466,7 @@ struct NetConnInfo
 	char	*laddr;		/* local address */
 	char	*raddr;		/* remote address */
 };
-extern	NetConnInfo*	getnetconninfo(char*, int);
+extern	NetConnInfo*	getnetconninfo(const char*, int);
 extern	void		freenetconninfo(NetConnInfo*);
 
 /*
@@ -602,48 +589,48 @@ struct IOchunk
 	uint32_t	len;
 } IOchunk;
 
-extern	void	_exits(char*);
+extern	void	_exits(const char*);
 
-extern	void	abort(void);
-extern	int	access(char*, int);
-extern	int32_t	alarm(uint32_t);
+extern	int	access(const char*, int);
+extern	int64_t	alarm(uint64_t);
 extern	int	await(char*, int);
-extern	int	bind(char*, char*, int);
+extern	int	bind(const char*, const char*, int);
 extern	int	brk(void*);
-extern	int	chdir(char*);
+extern	int	chdir(const char*);
 extern	int	close(int);
-extern	int	create(char*, int, uint32_t);
+extern	int	create(const char*, int, uint32_t);
 extern	int	dup(int, int);
 extern	int	errstr(char*, uint);
-extern	int	exec(char*, char*[]);
-extern	int	execl(char*, ...);
+extern	int	exec(const char*, char* const[]);
+extern	int	execl(const char*, ...);
 extern	int	fork(void);
 extern	int	rfork(int);
-extern	int	fauth(int, char*);
+extern	int	fauth(int, const char*);
 extern	int	fstat(int, uint8_t*, int);
 extern	int	fwstat(int, uint8_t*, int);
 extern	int	fversion(int, int, char*, int);
-extern	int	mount(int, int, char*, int, char*, int);
-extern	int	unmount(char*, char*);
+extern	int	mount(int, int, const char*, int, const char*, int);
+extern	int	unmount(const char*, const char*);
 extern	int	noted(int);
 extern	int	notify(void(*)(void*, char*));
-extern	int	open(char*, int);
+extern	int	open(const char*, int);
 extern	int	fd2path(int, char*, int);
 // extern	int	fdflush(int);
 extern	int	pipe(int*);
 extern	int32_t	pread(int, void*, int32_t, int64_t);
+extern	ssize_t read(int, void*, int32_t);
 extern	int32_t	preadv(int, IOchunk*, int, int64_t);
-extern	int32_t	pwrite(int, void*, int32_t, int64_t);
+extern	int32_t	pwrite(int, const void*, int32_t, int64_t);
+extern	ssize_t write(int, const void*, int32_t);
 extern	int32_t	pwritev(int, IOchunk*, int, int64_t);
 extern	int32_t	r0(void);
-extern	int32_t	read(int, void*, int32_t);
 extern	int32_t	readn(int, void*, int32_t);
 extern	int32_t	readv(int, IOchunk*, int);
-extern	int	remove(char*);
+extern	int	remove(const char*);
 extern	void*	sbrk(uint32_t);
 extern	int32_t	oseek(int, int32_t, int);
 extern	int64_t	seek(int, int64_t, int);
-extern	void*	segattach(int, char*, void*, uint32_t);
+extern	void*	segattach(int, const char*, void*, uint32_t);
 extern	void*	segbrk(void*, void*);
 extern	int	segdetach(void*);
 extern	int	segflush(void*, uint32_t);
@@ -655,14 +642,13 @@ extern	int	stat(const char*, uint8_t*, int);
 extern	int	tsemacquire(int32_t*, uint64_t);
 extern	Waitmsg*	wait(void);
 extern	int	waitpid(void);
-extern	int32_t	write(int, void*, int32_t);
 extern	int32_t	writev(int, IOchunk*, int);
-extern	int	wstat(char*, uint8_t*, int);
+extern	int	wstat(const char*, uint8_t*, int);
 extern	void*	rendezvous(void*, void*);
 
-extern	Dir*	dirstat(char*);
+extern	Dir*	dirstat(const char*);
 extern	Dir*	dirfstat(int);
-extern	int	dirwstat(char*, Dir*);
+extern	int	dirwstat(const char*, Dir*);
 extern	int	dirfwstat(int, Dir*);
 extern	int32_t	dirread(int, Dir**);
 extern	void	nulldir(Dir*);

+ 0 - 74
sys/include/libsec.h

@@ -5,10 +5,6 @@
  * 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.
-
- * Portions of this file are copyright cinap_lenrek <cinap_lenrek@felloff.net>
- * and are made available under the terms of the MIT license that can be found
- * in the LICENSE.mit file.
  */
 
 /*
@@ -405,18 +401,14 @@ typedef struct TLSconn{
 	char	dir[40];	/* connection directory */
 	uint8_t	*cert;	/* certificate (local on input, remote on output) */
 	uint8_t	*sessionID;
-	uint8_t	*psk;
 	int	certlen;
 	int	sessionIDlen;
-	int	psklen;
 	int	(*trace)(char*fmt, ...);
 	PEMChain*chain;	/* optional extra certificate evidence for servers to present */
 	char	*sessionType;
 	uint8_t	*sessionKey;
 	int	sessionKeylen;
 	char	*sessionConst;
-	char	*serverName;
-	char	*pskID;
 } TLSconn;
 
 /* tlshand.c */
@@ -432,69 +424,3 @@ int	okThumbprint(uint8_t *sha1, Thumbprint *ok);
 uint8_t	*readcert(char *filename, int *pcertlen);
 PEMChain*readcertchain(char *filename);
 
-/*
- * Diffie-Hellman key exchange
- */
-
-typedef struct DHstate DHstate;
-struct DHstate
-{
-	mpint	*g;	/* base g */
-	mpint	*p;	/* large prime */
-	mpint	*q;	/* subgroup prime */
-	mpint	*x;	/* random secret */
-	mpint	*y;	/* public key y = g**x % p */
-};
-
-/* generate new public key: y = g**x % p */
-mpint* dh_new(DHstate *dh, mpint *p, mpint *q, mpint *g);
-
-/* calculate shared key: k = y**x % p */
-mpint* dh_finish(DHstate *dh, mpint *y);
-
-typedef struct ECpoint ECpoint;
-struct ECpoint{
-	int inf;
-	mpint *x;
-	mpint *y;
-	mpint *z;	/* nil when using affine coordinates */
-};
-
-typedef ECpoint ECpub;
-
-typedef struct ECdomain ECdomain;
-struct ECdomain{
-	mpint *p;
-	mpint *a;
-	mpint *b;
-	ECpoint G;
-	mpint *n;
-	mpint *h;
-};
-
-typedef struct ECpriv ECpriv;
-struct ECpriv{
-	ECpoint ecpoint;
-	mpint *d;
-};
-
-
-void	ecdominit(ECdomain *, void (*init)(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h));
-void	ecdomfree(ECdomain *);
-ECpub*	ecdecodepub(ECdomain *dom, uint8_t *, int);
-int	ecencodepub(ECdomain *dom, ECpub *, uint8_t *, int);
-int	ecdsaverify(ECdomain *, ECpub *, uint8_t *, int, mpint *, mpint *);
-ECpriv*	ecgen(ECdomain *, ECpriv*);
-void	ecmul(ECdomain *, ECpoint *a, mpint *k, ECpoint *s);
-void	ecpubfree(ECpub *);
-
-char*	X509ecdsaverifydigest(uint8_t *sig, int siglen, uint8_t *edigest, int edigestlen, ECdomain *dom, ECpub *pub);
-ECpub* X509toECpub(uint8_t *cert, int ncert, char *name, int nname, ECdomain *dom);
-char* X509rsaverifydigest(uint8_t *sig, int siglen, uint8_t *edigest, int edigestlen, RSApub *pk);
-
-
-int tsmemcmp(void *a1, void *a2, uint32_t n);
-
-//curves
-void	secp256r1(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h);
-void	secp384r1(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h);

+ 1 - 28
sys/include/mp.h

@@ -5,10 +5,6 @@
  * 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.
-
- * Portions of this file are copyright cinap_lenrek <cinap_lenrek@felloff.net>
- * and are made available under the terms of the MIT license that can be found
- * in the LICENSE.mit file.
  */
 
 
@@ -33,10 +29,7 @@ struct mpint
 
 enum
 {
-	MPstatic=	0x01,	/* static constant */
-	MPnorm=		0x02,	/* normalization status */
-	MPtimesafe=	0x04,	/* request time invariant computation */
-	MPfield=	0x08,	/* this mpint is a field modulus */
+	MPstatic=	0x01,
 	Dbytes=		sizeof(mpdigit),	/* bytes per digit */
 	Dbits=		Dbytes*8		/* bits per digit */
 };
@@ -52,7 +45,6 @@ void	mpassign(mpint *old, mpint *new);
 
 /* random bits */
 mpint*	mprand(int bits, void (*gen)(uint8_t*, int), mpint *b);
-mpint* mpnrand(mpint *n, void (*gen)(uint8_t*, int), mpint *b);
 
 /* conversion */
 mpint*	strtomp(char*, char**, int, mpint*);	/* ascii */
@@ -70,7 +62,6 @@ uint64_t	mptouv(mpint*);			/* unsigned vlong */
 mpint*	uvtomp(uint64_t, mpint*);
 int64_t	mptov(mpint*);			/* vlong */
 mpint*	vtomp(int64_t, mpint*);
-void mptober(mpint *b, uint8_t *p, int n);
 
 /* divide 2 digits by one */
 void	mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);
@@ -85,11 +76,6 @@ void	mpmul(mpint *b1, mpint *b2, mpint *prod);	/* prod = b1*b2 */
 void	mpexp(mpint *b, mpint *e, mpint *m, mpint *res);	/* res = b**e mod m */
 void	mpmod(mpint *b, mpint *m, mpint *remainder);	/* remainder = b mod m */
 
-/* modular arithmetic, time invariant when 0≤b1≤m-1 and 0≤b2≤m-1 */
-void	mpmodadd(mpint *b1, mpint *b2, mpint *m, mpint *sum);	/* sum = b1+b2 % m */
-void	mpmodsub(mpint *b1, mpint *b2, mpint *m, mpint *diff);	/* diff = b1-b2 % m */
-void	mpmodmul(mpint *b1, mpint *b2, mpint *m, mpint *prod);	/* prod = b1*b2 % m */
-
 /* quotient = dividend/divisor, remainder = dividend % divisor */
 void	mpdiv(mpint *dividend, mpint *divisor,  mpint *quotient, mpint *remainder);
 
@@ -159,16 +145,3 @@ void	crtout(CRTpre*, CRTres*, mpint*);	/* convert residues to mpint */
 void	crtprefree(CRTpre*);
 void	crtresfree(CRTres*);
 
-/* fast field arithmetic */
-typedef struct Mfield	Mfield;
-
-struct Mfield
-{
-	mpint mpi;
-	int	(*reduce)(Mfield*, mpint*, mpint*);
-};
-
-mpint *mpfield(mpint*);
-
-Mfield *gmfield(mpint*);
-Mfield *cnfield(mpint*);

+ 0 - 12
sys/include/tos.h

@@ -8,20 +8,8 @@
  */
 
 typedef struct Tos Tos;
-typedef struct Plink Plink;
-
-#pragma incomplete Plink
 
 struct Tos {
-	struct			/* Per process profiling */
-	{
-		Plink	*pp;	/* known to be 0(ptr) */
-		Plink	*next;	/* known to be 4(ptr) */
-		Plink	*last;
-		Plink	*first;
-		uint32_t	pid;
-		uint32_t	what;
-	} prof;
 	uint64_t	cyclefreq;	/* cycle clock frequency if there is one, 0 otherwise */
 	int64_t	kcycles;	/* cycles spent in kernel */
 	int64_t	pcycles;	/* cycles spent in process (kernel + user) */

+ 0 - 40
sys/src/libc/386/387/asin.s

@@ -1,40 +0,0 @@
-TEXT	asin(SB), $0
-	FMOVD	a+0(FP), F0	/* a */
-	FMOVD	F0, F0		/* a,a */
-	FMULD	F0, F0		/* a*a,a */
-	FLD1			/* 1,a*a,a */
-	FSUBRDP	F0, F1		/* 1-a*a,a */
-
-	FTST
-	WAIT
-	FSTSW	AX
-	SAHF
-	JLO	bad
-
-	FSQRT			/* sqrt(1-a*a),a */
-	FPATAN			/* atan2(sqrt(1-a*a),a) */
-	RET
-
-TEXT	acos(SB), $0
-	FMOVD	a+0(FP), F0
-	FMOVD	F0, F0
-	FMULD	F0, F0
-	FLD1
-	FSUBRDP	F0, F1
-
-	FTST
-	WAIT
-	FSTSW	AX
-	SAHF
-	JLO	bad
-
-	FSQRT
-	FXCHD	F0, F1		/* identical except this */
-	FPATAN
-	RET
-
-bad:
-	FMOVDP	F0, F0
-	FMOVDP	F0, F0
-	CALL	NaN(SB)
-	RET

+ 0 - 5
sys/src/libc/386/387/atan.s

@@ -1,5 +0,0 @@
-TEXT	atan(SB), $0
-	FMOVD	a+0(FP), F0
-	FLD1
-	FPATAN
-	RET

+ 0 - 5
sys/src/libc/386/387/atan2.s

@@ -1,5 +0,0 @@
-TEXT	atan2(SB), $0
-	FMOVD	a+0(FP), F0
-	FMOVD	b+8(FP), F0
-	FPATAN
-	RET

+ 0 - 13
sys/src/libc/386/387/exp.s

@@ -1,13 +0,0 @@
-TEXT	exp(SB), $0
-	FLDL2E
-	FMULD	a+0(FP), F0	/* now we want 2^ this number */
-
-	FMOVD	F0, F0		/* x, x */
-	FRNDINT			/* ix, x -- this is best in round mode */
-	FSUBD	F0, F1		/* ix, fx */
-	FXCHD	F0, F1		/* fx, ix */
-	F2XM1			/* 2^fx-1, ix */
-	FADDD	$1.0, F0	/* 2^fx, ix */
-	FSCALE			/* 2^(fx+ix), ix */
-	FMOVDP	F0, F1		/* 2^(fx+ix) == 2^x */
-	RET

+ 0 - 31
sys/src/libc/386/387/log.s

@@ -1,31 +0,0 @@
-TEXT	log(SB), $0
-	FMOVD	$0.69314718055994530941, F0
-	FMOVD	a+0(FP), F0
-
-	FTST
-	WAIT
-	FSTSW	AX
-	SAHF
-	JLO	bad
-
-	FYL2X
-	RET
-
-TEXT	log10(SB), $0
-	FMOVD	$0.30102999566398119521, F0
-	FMOVD	a+0(FP), F0
-
-	FTST
-	WAIT
-	FSTSW	AX
-	SAHF
-	JLO	bad
-
-	FYL2X
-	RET
-
-bad:
-	FMOVDP	F0, F0
-	FMOVDP	F0, F0
-	CALL	NaN(SB)
-	RET

+ 0 - 9
sys/src/libc/386/387/sin.s

@@ -1,9 +0,0 @@
-TEXT	sin(SB), $0
-	FMOVD	a+0(FP), F0
-	FSIN
-	RET
-
-TEXT	cos(SB), $0
-	FMOVD	a+0(FP), F0
-	FCOS
-	RET

+ 0 - 16
sys/src/libc/386/387/sqrt.s

@@ -1,16 +0,0 @@
-TEXT	sqrt(SB), $0
-	FMOVD	a+0(FP), F0
-
-	FTST
-	WAIT
-	FSTSW	AX
-	SAHF
-	JLO	bad
-
-	FSQRT
-	RET
-
-bad:
-	FMOVDP	F0, F0
-	CALL	NaN(SB)
-	RET

+ 0 - 5
sys/src/libc/386/387/tan.s

@@ -1,5 +0,0 @@
-TEXT	tan(SB), $0
-	FMOVD	a+0(FP), F0
-	FPTAN
-	FMOVDP	F0, F0		/* get rid of extra 1.0 */
-	RET

+ 0 - 4
sys/src/libc/386/argv0.s

@@ -1,4 +0,0 @@
-GLOBL	argv0(SB), $4
-GLOBL	_tos(SB), $4
-GLOBL	_privates(SB), $4
-GLOBL	_nprivates(SB), $4

+ 0 - 75
sys/src/libc/386/atom.s

@@ -1,75 +0,0 @@
-TEXT ainc(SB), $0	/* long ainc(long *); */
-	MOVL	addr+0(FP), BX
-ainclp:
-	MOVL	(BX), AX
-	MOVL	AX, CX
-	INCL	CX
-	LOCK
-	BYTE	$0x0F; BYTE $0xB1; BYTE $0x0B	/* CMPXCHGL CX, (BX) */
-	JNZ	ainclp
-	MOVL	CX, AX
-	RET
-
-TEXT adec(SB), $0	/* long adec(long*); */
-	MOVL	addr+0(FP), BX
-adeclp:
-	MOVL	(BX), AX
-	MOVL	AX, CX
-	DECL	CX
-	LOCK
-	BYTE	$0x0F; BYTE $0xB1; BYTE $0x0B	/* CMPXCHGL CX, (BX) */
-	JNZ	adeclp
-	MOVL	CX, AX
-	RET
-
-/*
- * int cas32(u32int *p, u32int ov, u32int nv);
- * int cas(uint *p, int ov, int nv);
- * int casp(void **p, void *ov, void *nv);
- * int casl(ulong *p, ulong ov, ulong nv);
- */
-
-/*
- * CMPXCHG (CX), DX: 0000 1111 1011 000w oorr rmmm,
- * mmm = CX = 001; rrr = DX = 010
- */
-
-#define CMPXCHG		BYTE $0x0F; BYTE $0xB1; BYTE $0x11
-
-TEXT	cas32+0(SB),0,$0
-TEXT	cas+0(SB),0,$0
-TEXT	casp+0(SB),0,$0
-TEXT	casl+0(SB),0,$0
-	MOVL	p+0(FP), CX
-	MOVL	ov+4(FP), AX
-	MOVL	nv+8(FP), DX
-	LOCK
-	CMPXCHG
-	JNE	fail
-	MOVL	$1,AX
-	RET
-fail:
-	MOVL	$0,AX
-	RET
-
-/*
- * int cas64(u64int *p, u64int ov, u64int nv);
- */
-
-/*
- * CMPXCHG64 (DI): 0000 1111 1100 0111 0000 1110,
- */
-
-#define CMPXCHG64		BYTE $0x0F; BYTE $0xC7; BYTE $0x0F
-
-TEXT	cas64+0(SB),0,$0
-	MOVL	p+0(FP), DI
-	MOVL	ov+0x4(FP), AX
-	MOVL	ov+0x8(FP), DX
-	MOVL	nv+0xc(FP), BX
-	MOVL	nv+0x10(FP), CX
-	LOCK
-	CMPXCHG64
-	JNE	fail
-	MOVL	$1,AX
-	RET

+ 0 - 8
sys/src/libc/386/cycles.s

@@ -1,8 +0,0 @@
-#define RDTSC 		BYTE $0x0F; BYTE $0x31
-
-TEXT cycles(SB),1,$0		/* time stamp counter; cycles since power up */
-	RDTSC
-	MOVL	vlong+0(FP), CX	/* &vlong */
-	MOVL	AX, 0(CX)	/* lo */
-	MOVL	DX, 4(CX)	/* hi */
-	RET

+ 0 - 4
sys/src/libc/386/getcallerpc.s

@@ -1,4 +0,0 @@
-TEXT getcallerpc(SB), $0
-	MOVL	v+0(FP), AX
-	MOVL	-4(AX), AX
-	RET

+ 0 - 27
sys/src/libc/386/getfcr.s

@@ -1,27 +0,0 @@
-
-TEXT	setfcr(SB), $4
-	MOVL	p+0(FP),AX
-	XORB	$0x3f,AX
-	MOVW	AX, 0(SP)
-	WAIT
-	FLDCW	0(SP)
-	MOVW	0(SP), AX
-	RET
-
-TEXT	getfcr(SB), $4
-	MOVW	AX, 0(SP)
-	WAIT
-	FSTCW	0(SP)
-	MOVW	0(SP), AX
-	XORB	$0x3f,AX
-	RET
-
-TEXT	getfsr(SB), $0
-	WAIT
-	FSTSW	AX
-	RET
-
-TEXT	setfsr(SB), $0
-	WAIT
-	FCLEX
-	RET

+ 0 - 21
sys/src/libc/386/main9.s

@@ -1,21 +0,0 @@
-#define NPRIVATES	16
-
-TEXT	_main(SB), 1, $(8+NPRIVATES*4)
-	MOVL	AX, _tos(SB)
-	LEAL	8(SP), AX
-	MOVL	AX, _privates(SB)
-	MOVL	$NPRIVATES, _nprivates(SB)
-	MOVL	inargc-4(FP), AX
-	MOVL	AX, 0(SP)
-	LEAL	inargv+0(FP), AX
-	MOVL	AX, 4(SP)
-	CALL	main(SB)
-
-loop:
-	MOVL	$_exits<>(SB), AX
-	MOVL	AX, 0(SP)
-	CALL	exits(SB)
-	JMP	loop
-
-DATA	_exits<>+0(SB)/4, $"main"
-GLOBL	_exits<>+0(SB), $5

+ 0 - 38
sys/src/libc/386/main9p.s

@@ -1,38 +0,0 @@
-#define NPRIVATES	16
-
-TEXT	_mainp(SB), 1, $(8+NPRIVATES*4)
-	/* _tos = arg */
-	MOVL	AX, _tos(SB)
-	LEAL	8(SP), AX
-	MOVL	AX, _privates(SB)
-	MOVL	$NPRIVATES, _nprivates(SB)
-	/* _profmain(); */
-	CALL	_profmain(SB)
-	/* _tos->prof.pp = _tos->prof.next; */
-	MOVL	_tos+0(SB),DX
-	MOVL	4(DX),CX
-	MOVL	CX,(DX)
-	/* main(argc, argv); */
-	MOVL	inargc-4(FP), AX
-	MOVL	AX, 0(SP)
-	LEAL	inargv+0(FP), AX
-	MOVL	AX, 4(SP)
-	CALL	main(SB)
-
-loop:
-	MOVL	$_exits<>(SB), AX
-	MOVL	AX, 0(SP)
-	CALL	exits(SB)
-	MOVL	$_profin(SB), AX	/* force loading of profile */
-	JMP	loop
-
-TEXT	_savearg(SB), 1, $0
-	RET
-
-TEXT	_callpc(SB), 1, $0
-	MOVL	argp+0(FP), AX
-	MOVL	4(AX), AX
-	RET
-
-DATA	_exits<>+0(SB)/4, $"main"
-GLOBL	_exits<>+0(SB), $5

+ 0 - 53
sys/src/libc/386/memccpy.s

@@ -1,53 +0,0 @@
-	TEXT	memccpy(SB),$0
-
-	MOVL	n+12(FP), CX
-	CMPL	CX, $0
-	JEQ	none
-	MOVL	p2+4(FP), DI
-	MOVBLZX	c+8(FP), AX
-	CLD
-/*
- * find the character in the second string
- */
-
-	REPN;	SCASB
-	JEQ	found
-
-/*
- * if not found, set count to 'n'
- */
-none:
-	MOVL	$0, AX
-	MOVL	n+12(FP), BX
-	JMP	memcpy
-
-/*
- * if found, set count to bytes thru character
- */
-found:
-	MOVL	DI, AX
-	SUBL	p2+4(FP), AX
-	MOVL	AX, BX
-	ADDL	p1+0(FP), AX
-
-/*
- * copy the memory
- */
-
-memcpy:
-	MOVL	p1+0(FP), DI
-	MOVL	p2+4(FP), SI
-/*
- * copy whole longs
- */
-	MOVL	BX, CX
-	SHRL	$2, CX
-	REP;	MOVSL
-/*
- * copy the rest, by bytes
- */
-	ANDL	$3, BX
-	MOVL	BX, CX
-	REP;	MOVSB
-
-	RET

+ 0 - 23
sys/src/libc/386/memchr.s

@@ -1,23 +0,0 @@
-	TEXT	memchr(SB),$0
-
-	MOVL	n+8(FP), CX
-	CMPL	CX, $0
-	JEQ	none
-	MOVL	p+0(FP), DI
-	MOVBLZX	c+4(FP), AX
-	CLD
-/*
- * SCASB is memchr instruction
- */
-
-	REPN;	SCASB
-	JEQ	found
-
-none:
-	MOVL	$0, AX
-	RET
-
-found:
-	MOVL	DI, AX
-	SUBL	$1, AX