Browse Source

Reintroducing headers, toolset and libc (#730)

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
3480514be3
100 changed files with 168 additions and 3963 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 41
      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	uint32_t;
 typedef unsigned int	uint;
 typedef unsigned int	uint;
 typedef signed int	int32_t;
 typedef signed int	int32_t;
+typedef long		ssize_t;
 typedef	unsigned long long uint64_t;
 typedef	unsigned long long uint64_t;
 typedef	long long	int64_t;
 typedef	long long	int64_t;
 typedef uint64_t uintptr;
 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
  * 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	tolowerrune(Rune);
 extern	Rune	totitlerune(Rune);
 extern	Rune	totitlerune(Rune);
@@ -154,24 +154,24 @@ enum{
 	FmtFlag		= FmtByte << 1
 	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	fmtfdinit(Fmt*, int, char*, int);
 extern	int	fmtfdflush(Fmt*);
 extern	int	fmtfdflush(Fmt*);
@@ -183,13 +183,13 @@ extern	Rune*	runefmtstrflush(Fmt*);
 
 
 
 
 extern	int	fmtinstall(int, int (*)(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	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
  * error string for %r
  * supplied on per os basis, not part of fmt library
  * supplied on per os basis, not part of fmt library
@@ -199,10 +199,10 @@ extern	int	errfmt(Fmt *f);
 /*
 /*
  * quoted strings
  * 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	quotestrfmt(Fmt*);
 extern	int	quoterunestrfmt(Fmt*);
 extern	int	quoterunestrfmt(Fmt*);
 extern	void	quotefmtinstall(void);
 extern	void	quotefmtinstall(void);
@@ -299,27 +299,27 @@ enum
 	PNGROUP		= 2,
 	PNGROUP		= 2,
 };
 };
 
 
-extern	void	_assert(char*);
+extern	void	_assert(const char*);
 extern	int	abs(int);
 extern	int	abs(int);
 extern	int	atexit(void(*)(void));
 extern	int	atexit(void(*)(void));
 extern	void	atexitdont(void(*)(void));
 extern	void	atexitdont(void(*)(void));
 extern	int	atnotify(int(*)(void*, char*), int);
 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	double	charstod(int(*)(void*), void*);
 extern	char*	cleanname(char*);
 extern	char*	cleanname(char*);
 extern	int	decrypt(void*, void*, int);
 extern	int	decrypt(void*, void*, int);
 extern	int	encrypt(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	int	encodefmt(Fmt*);
-extern	void	exits(char*);
+extern	void	exits(const char*);
 extern	double	frexp(double, int*);
 extern	double	frexp(double, int*);
 extern	void	getcallstack(uintptr *, size_t);
 extern	void	getcallstack(uintptr *, size_t);
 extern	char*	getenv(const char*);
 extern	char*	getenv(const char*);
@@ -333,12 +333,11 @@ extern	double	ldexp(double, int);
 extern	void	longjmp(jmp_buf, int);
 extern	void	longjmp(jmp_buf, int);
 extern	char*	mktemp(char*);
 extern	char*	mktemp(char*);
 extern	double	modf(double, double*);
 extern	double	modf(double, double*);
-extern	int	netcrypt(void*, void*);
 extern	void	notejmp(void*, jmp_buf, int);
 extern	void	notejmp(void*, jmp_buf, int);
 extern	void	perror(const char*);
 extern	void	perror(const char*);
-extern	int	postnote(int, int, char *);
+extern	int	postnote(int, int, const char *);
 extern	double	pow10(int);
 extern	double	pow10(int);
-extern	int	putenv(char*, char*);
+extern	int	putenv(const char*, const char*);
 extern	void	qsort(void*, int32_t, int32_t,
 extern	void	qsort(void*, int32_t, int32_t,
 				int (*)(const void*, const void*));
 				int (*)(const void*, const void*));
 extern	int	setjmp(jmp_buf) __attribute__((returns_twice));;
 extern	int	setjmp(jmp_buf) __attribute__((returns_twice));;
@@ -353,18 +352,6 @@ extern	int32_t	time(int32_t*);
 extern	int	tolower(int);
 extern	int	tolower(int);
 extern	int	toupper(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
  * atomic
  */
  */
@@ -447,20 +434,20 @@ extern	void	privfree(void**);
  *  network dialing
  *  network dialing
  */
  */
 #define NETPATHLEN 40
 #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	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
  *  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*);
 				 char*);
 
 
 /*
 /*
@@ -479,7 +466,7 @@ struct NetConnInfo
 	char	*laddr;		/* local address */
 	char	*laddr;		/* local address */
 	char	*raddr;		/* remote address */
 	char	*raddr;		/* remote address */
 };
 };
-extern	NetConnInfo*	getnetconninfo(char*, int);
+extern	NetConnInfo*	getnetconninfo(const char*, int);
 extern	void		freenetconninfo(NetConnInfo*);
 extern	void		freenetconninfo(NetConnInfo*);
 
 
 /*
 /*
@@ -602,48 +589,48 @@ struct IOchunk
 	uint32_t	len;
 	uint32_t	len;
 } IOchunk;
 } 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	await(char*, int);
-extern	int	bind(char*, char*, int);
+extern	int	bind(const char*, const char*, int);
 extern	int	brk(void*);
 extern	int	brk(void*);
-extern	int	chdir(char*);
+extern	int	chdir(const char*);
 extern	int	close(int);
 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	dup(int, int);
 extern	int	errstr(char*, uint);
 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	fork(void);
 extern	int	rfork(int);
 extern	int	rfork(int);
-extern	int	fauth(int, char*);
+extern	int	fauth(int, const char*);
 extern	int	fstat(int, uint8_t*, int);
 extern	int	fstat(int, uint8_t*, int);
 extern	int	fwstat(int, uint8_t*, int);
 extern	int	fwstat(int, uint8_t*, int);
 extern	int	fversion(int, int, char*, 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	noted(int);
 extern	int	notify(void(*)(void*, char*));
 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	fd2path(int, char*, int);
 // extern	int	fdflush(int);
 // extern	int	fdflush(int);
 extern	int	pipe(int*);
 extern	int	pipe(int*);
 extern	int32_t	pread(int, void*, int32_t, int64_t);
 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	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	pwritev(int, IOchunk*, int, int64_t);
 extern	int32_t	r0(void);
 extern	int32_t	r0(void);
-extern	int32_t	read(int, void*, int32_t);
 extern	int32_t	readn(int, void*, int32_t);
 extern	int32_t	readn(int, void*, int32_t);
 extern	int32_t	readv(int, IOchunk*, int);
 extern	int32_t	readv(int, IOchunk*, int);
-extern	int	remove(char*);
+extern	int	remove(const char*);
 extern	void*	sbrk(uint32_t);
 extern	void*	sbrk(uint32_t);
 extern	int32_t	oseek(int, int32_t, int);
 extern	int32_t	oseek(int, int32_t, int);
 extern	int64_t	seek(int, int64_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	void*	segbrk(void*, void*);
 extern	int	segdetach(void*);
 extern	int	segdetach(void*);
 extern	int	segflush(void*, uint32_t);
 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	int	tsemacquire(int32_t*, uint64_t);
 extern	Waitmsg*	wait(void);
 extern	Waitmsg*	wait(void);
 extern	int	waitpid(void);
 extern	int	waitpid(void);
-extern	int32_t	write(int, void*, int32_t);
 extern	int32_t	writev(int, IOchunk*, int);
 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	void*	rendezvous(void*, void*);
 
 
-extern	Dir*	dirstat(char*);
+extern	Dir*	dirstat(const char*);
 extern	Dir*	dirfstat(int);
 extern	Dir*	dirfstat(int);
-extern	int	dirwstat(char*, Dir*);
+extern	int	dirwstat(const char*, Dir*);
 extern	int	dirfwstat(int, Dir*);
 extern	int	dirfwstat(int, Dir*);
 extern	int32_t	dirread(int, Dir**);
 extern	int32_t	dirread(int, Dir**);
 extern	void	nulldir(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,
  * part of the UCB release of Plan 9, including this file, may be copied,
  * modified, propagated, or distributed except according to the terms contained
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  * 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 */
 	char	dir[40];	/* connection directory */
 	uint8_t	*cert;	/* certificate (local on input, remote on output) */
 	uint8_t	*cert;	/* certificate (local on input, remote on output) */
 	uint8_t	*sessionID;
 	uint8_t	*sessionID;
-	uint8_t	*psk;
 	int	certlen;
 	int	certlen;
 	int	sessionIDlen;
 	int	sessionIDlen;
-	int	psklen;
 	int	(*trace)(char*fmt, ...);
 	int	(*trace)(char*fmt, ...);
 	PEMChain*chain;	/* optional extra certificate evidence for servers to present */
 	PEMChain*chain;	/* optional extra certificate evidence for servers to present */
 	char	*sessionType;
 	char	*sessionType;
 	uint8_t	*sessionKey;
 	uint8_t	*sessionKey;
 	int	sessionKeylen;
 	int	sessionKeylen;
 	char	*sessionConst;
 	char	*sessionConst;
-	char	*serverName;
-	char	*pskID;
 } TLSconn;
 } TLSconn;
 
 
 /* tlshand.c */
 /* tlshand.c */
@@ -432,69 +424,3 @@ int	okThumbprint(uint8_t *sha1, Thumbprint *ok);
 uint8_t	*readcert(char *filename, int *pcertlen);
 uint8_t	*readcert(char *filename, int *pcertlen);
 PEMChain*readcertchain(char *filename);
 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,
  * part of the UCB release of Plan 9, including this file, may be copied,
  * modified, propagated, or distributed except according to the terms contained
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  * 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
 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 */
 	Dbytes=		sizeof(mpdigit),	/* bytes per digit */
 	Dbits=		Dbytes*8		/* bits per digit */
 	Dbits=		Dbytes*8		/* bits per digit */
 };
 };
@@ -52,7 +45,6 @@ void	mpassign(mpint *old, mpint *new);
 
 
 /* random bits */
 /* random bits */
 mpint*	mprand(int bits, void (*gen)(uint8_t*, int), mpint *b);
 mpint*	mprand(int bits, void (*gen)(uint8_t*, int), mpint *b);
-mpint* mpnrand(mpint *n, void (*gen)(uint8_t*, int), mpint *b);
 
 
 /* conversion */
 /* conversion */
 mpint*	strtomp(char*, char**, int, mpint*);	/* ascii */
 mpint*	strtomp(char*, char**, int, mpint*);	/* ascii */
@@ -70,7 +62,6 @@ uint64_t	mptouv(mpint*);			/* unsigned vlong */
 mpint*	uvtomp(uint64_t, mpint*);
 mpint*	uvtomp(uint64_t, mpint*);
 int64_t	mptov(mpint*);			/* vlong */
 int64_t	mptov(mpint*);			/* vlong */
 mpint*	vtomp(int64_t, mpint*);
 mpint*	vtomp(int64_t, mpint*);
-void mptober(mpint *b, uint8_t *p, int n);
 
 
 /* divide 2 digits by one */
 /* divide 2 digits by one */
 void	mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);
 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	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 */
 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 */
 /* quotient = dividend/divisor, remainder = dividend % divisor */
 void	mpdiv(mpint *dividend, mpint *divisor,  mpint *quotient, mpint *remainder);
 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	crtprefree(CRTpre*);
 void	crtresfree(CRTres*);
 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 Tos Tos;
-typedef struct Plink Plink;
-
-#pragma incomplete Plink
 
 
 struct Tos {
 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 */
 	uint64_t	cyclefreq;	/* cycle clock frequency if there is one, 0 otherwise */
 	int64_t	kcycles;	/* cycles spent in kernel */
 	int64_t	kcycles;	/* cycles spent in kernel */
 	int64_t	pcycles;	/* cycles spent in process (kernel + user) */
 	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
-	RET

+ 0 - 47
sys/src/libc/386/memcmp.s

@@ -1,47 +0,0 @@
-	TEXT	memcmp(SB),$0
-
-	MOVL	n+8(FP), BX
-	CMPL	BX, $0
-	JEQ	none
-	MOVL	p1+0(FP), DI
-	MOVL	p2+4(FP), SI
-	CLD
-/*
- * first by longs
- */
-
-	MOVL	BX, CX
-	SHRL	$2, CX
-
-	REP;	CMPSL
-	JNE	found
-
-/*
- * then by bytes
- */
-	ANDL	$3, BX
-	MOVL	BX, CX
-	REP;	CMPSB
-	JNE	found1
-
-none:
-	MOVL	$0, AX
-	RET
-
-/*
- * if long found,
- * back up and look by bytes
- */
-found:
-	MOVL	$4, CX
-	SUBL	CX, DI
-	SUBL	CX, SI
-	REP;	CMPSB
-
-found1:
-	JLS	lt
-	MOVL	$-1, AX
-	RET
-lt:
-	MOVL	$1, AX
-	RET

+ 0 - 57
sys/src/libc/386/memcpy.s

@@ -1,57 +0,0 @@
-	TEXT	memcpy(SB), $0
-
-	MOVL	p1+0(FP), DI
-	MOVL	p2+4(FP), SI
-	MOVL	n+8(FP), BX
-	CMPL	BX, $0
-	JGE	ok
-	MOVL	$0, SI
-ok:
-	CLD
-/*
- * check and set for backwards
- */
-	CMPL	SI, DI
-	JLS	back
-/*
- * copy whole longs
- */
-	MOVL	BX, CX
-	SHRL	$2, CX
-	REP;	MOVSL
-/*
- * copy the rest, by bytes
- */
-	ANDL	$3, BX
-	MOVL	BX, CX
-	REP;	MOVSB
-
-	MOVL	p+0(FP),AX
-	RET
-/*
- * whole thing backwards has
- * adjusted addresses
- */
-back:
-	ADDL	BX, DI
-	ADDL	BX, SI
-	SUBL	$4, DI
-	SUBL	$4, SI
-	STD
-/*
- * copy whole longs
- */
-	MOVL	BX, CX
-	SHRL	$2, CX
-	ANDL	$3, BX
-	REP;	MOVSL
-/*
- * copy the rest, by bytes
- */
-	ADDL	$3, DI
-	ADDL	$3, SI
-	MOVL	BX, CX
-	REP;	MOVSB
-
-	MOVL	p+0(FP),AX
-	RET

+ 0 - 71
sys/src/libc/386/memmove.s

@@ -1,71 +0,0 @@
-TEXT memmove(SB), $0
-	MOVL	p1+0(FP), DI
-	MOVL	DI, AX			/* return value */
-	MOVL	p2+4(FP), SI
-	MOVL	n+8(FP), BX
-	CMPL	BX, $0
-	JGT	_ok
-	JEQ	_return			/* nothing to do if n == 0 */
-	MOVL	$0, SI			/* fault if n < 0 */
-
-/*
- * check and set for backwards:
- *	(p2 < p1) && ((p2+n) > p1)
- */
-_ok:
-	CMPL	SI, DI
-	JGT	_forward
-	JEQ	_return			/* nothing to do if p2 == p1 */
-	MOVL	SI, DX
-	ADDL	BX, DX
-	CMPL	DX, DI
-	JGT	_back
-
-/*
- * copy whole longs
- */
-_forward:
-	MOVL	BX, CX
-	CLD
-	SHRL	$2, CX
-	ANDL	$3, BX
-	REP;	MOVSL
-
-/*
- * copy the rest, by bytes
- */
-	JEQ	_return			/* flags set by above ANDL */
-	MOVL	BX, CX
-	REP;	MOVSB
-
-	RET
-
-/*
- * whole thing backwards has
- * adjusted addresses
- */
-_back:
-	ADDL	BX, DI
-	ADDL	BX, SI
-	STD
-	SUBL	$4, DI
-	SUBL	$4, SI
-/*
- * copy whole longs
- */
-	MOVL	BX, CX
-	SHRL	$2, CX
-	ANDL	$3, BX
-	REP;	MOVSL
-/*
- * copy the rest, by bytes
- */
-	JEQ	_return			/* flags set by above ANDL */
-
-	ADDL	$3, DI
-	ADDL	$3, SI
-	MOVL	BX, CX
-	REP;	MOVSB
-
-_return:
-	RET

+ 0 - 35
sys/src/libc/386/memset.s

@@ -1,35 +0,0 @@
-	TEXT	memset(SB),$0
-
-	CLD
-	MOVL	p+0(FP), DI
-	MOVBLZX	c+4(FP), AX
-	MOVL	n+8(FP), BX
-/*
- * if not enough bytes, just set bytes
- */
-	CMPL	BX, $9
-	JLS	c3
-/*
- * build word in AX
- */
-	MOVB	AL, AH
-	MOVL	AX, CX
-	SHLL	$16, CX
-	ORL	CX, AX
-/*
- * set whole longs
- */
-c1:
-	MOVL	BX, CX
-	SHRL	$2, CX
-	ANDL	$3, BX
-	REP;	STOSL
-/*
- * set the rest, by bytes
- */
-c3:
-	MOVL	BX, CX
-	REP;	STOSB
-ret:
-	MOVL	p+0(FP),AX
-	RET

+ 0 - 12
sys/src/libc/386/muldiv.s

@@ -1,12 +0,0 @@
-TEXT	umuldiv(SB), $0
-	MOVL	a+0(FP), AX
-	MULL	b+4(FP)
-	DIVL	c+8(FP)
-	RET
-
-TEXT	muldiv(SB), $0
-	MOVL	a+0(FP), AX
-	IMULL	b+4(FP)
-	IDIVL	c+8(FP)
-	RET
-	END

+ 0 - 25
sys/src/libc/386/notejmp.c

@@ -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.
- */
-
-#include <u.h>
-#include <libc.h>
-#include <ureg.h>
-
-void
-notejmp(void *vr, jmp_buf j, int ret)
-{
-	struct Ureg *r = vr;
-
-	r->ax = ret;
-	if(ret == 0)
-		r->ax = 1;
-	r->pc = j[JMPBUFPC];
-	r->sp = j[JMPBUFSP] + 4;
-	noted(NCONT);
-}

+ 0 - 18
sys/src/libc/386/setjmp.s

@@ -1,18 +0,0 @@
-TEXT	longjmp(SB), $0
-	MOVL	r+4(FP), AX
-	CMPL	AX, $0
-	JNE	ok		/* ansi: "longjmp(0) => longjmp(1)" */
-	MOVL	$1, AX		/* bless their pointed heads */
-ok:	MOVL	l+0(FP), BX
-	MOVL	0(BX), SP	/* restore sp */
-	MOVL	4(BX), BX	/* put return pc on the stack */
-	MOVL	BX, 0(SP)
-	RET
-
-TEXT	setjmp(SB), $0
-	MOVL	l+0(FP), AX
-	MOVL	SP, 0(AX)	/* store sp */
-	MOVL	0(SP), BX	/* store return pc */
-	MOVL	BX, 4(AX)
-	MOVL	$0, AX		/* return 0 */
-	RET

+ 0 - 16
sys/src/libc/386/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 - 43
sys/src/libc/386/strcat.s

@@ -1,43 +0,0 @@
-	TEXT	strcat(SB),$0
-
-	MOVL	$0, AX
-	MOVL	$-1, CX
-	CLD
-
-/*
- * find length of second string
- */
-
-	MOVL	p2+4(FP), DI
-	REPN;	SCASB
-
-	MOVL	DI, BX
-	SUBL	p2+4(FP), BX
-
-/*
- * find end of first string
- */
-
-	MOVL	p1+0(FP), DI
-	REPN;	SCASB
-
-/*
- * copy the memory
- */
-	SUBL	$1, 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
-
-	MOVL	p1+0(FP), AX
-	RET

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

@@ -1,38 +0,0 @@
-	TEXT	strchr(SB), $0
-
-	MOVL	s+0(FP), DI
-	MOVB	c+4(FP), AX
-	CMPB	AX, $0
-	JEQ	l2	/**/
-
-/*
- * char is not null
- */
-l1:
-	MOVB	(DI), BX
-	CMPB	BX, $0
-	JEQ	ret0
-	ADDL	$1, DI
-	CMPB	AX, BX
-	JNE	l1
-
-	MOVL	DI, AX
-	SUBL	$1, AX
-	RET
-
-/*
- * char is null
- */
-l2:
-	MOVL	$-1, CX
-	CLD
-
-	REPN;	SCASB
-
-	MOVL	DI, AX
-	SUBL	$1, AX
-	RET
-
-ret0:
-	MOVL	$0, AX
-	RET

+ 0 - 35
sys/src/libc/386/strcpy.s

@@ -1,35 +0,0 @@
-	TEXT	strcpy(SB),$0
-
-	MOVL	$0, AX
-	MOVL	$-1, CX
-	CLD
-/*
- * find end of second string
- */
-
-	MOVL	p2+4(FP), DI
-	REPN;	SCASB
-
-	MOVL	DI, BX
-	SUBL	p2+4(FP), BX
-
-/*
- * copy the memory
- */
-	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
-
-	MOVL	p1+0(FP), AX
-	RET

+ 0 - 16
sys/src/libc/386/strlen.s

@@ -1,16 +0,0 @@
-	TEXT	strlen(SB),$0
-
-	MOVL	$0, AX
-	MOVL	$-1, CX
-	CLD
-/*
- * look for end of string
- */
-
-	MOVL	p+0(FP), DI
-	REPN;	SCASB
-
-	MOVL	DI, AX
-	SUBL	p+0(FP), AX
-	SUBL	$1, AX
-	RET

+ 0 - 6
sys/src/libc/386/tas.s

@@ -1,6 +0,0 @@
-TEXT	_tas(SB),$0
-
-	MOVL	$0xdeadead,AX
-	MOVL	l+0(FP),BX
-	XCHGL	AX,(BX)
-	RET

+ 0 - 62
sys/src/libc/386/vlop.s

@@ -1,62 +0,0 @@
-TEXT	_mulv(SB), $0
-	MOVL	r+0(FP), CX
-	MOVL	a+4(FP), AX
-	MULL	b+12(FP)
-	MOVL	AX, 0(CX)
-	MOVL	DX, BX
-	MOVL	a+4(FP), AX
-	MULL	b+16(FP)
-	ADDL	AX, BX
-	MOVL	a+8(FP), AX
-	MULL	b+12(FP)
-	ADDL	AX, BX
-	MOVL	BX, 4(CX)
-	RET
-
-/*
- * _mul64by32(uint64 *r, uint64 a, uint32 b)
- * sets *r = low 64 bits of 96-bit product a*b; returns high 32 bits.
- */
-TEXT	_mul64by32(SB), $0
-	MOVL	r+0(FP), CX
-	MOVL	a+4(FP), AX
-	MULL	b+12(FP)
-	MOVL	AX, 0(CX)	/* *r = low 32 bits of a*b */
-	MOVL	DX, BX		/* BX = high 32 bits of a*b */
-
-	MOVL	a+8(FP), AX
-	MULL	b+12(FP)	/* hi = (a>>32) * b */
-	ADDL	AX, BX		/* BX += low 32 bits of hi */
-	ADCL	$0, DX		/* DX = high 32 bits of hi + carry */
-	MOVL	BX, 4(CX)	/* *r |= (high 32 bits of a*b) << 32 */
-
-	MOVL	DX, AX		/* return hi>>32 */
-	RET
-
-TEXT	_div64by32(SB), $0
-	MOVL	r+12(FP), CX
-	MOVL	a+0(FP), AX
-	MOVL	a+4(FP), DX
-	DIVL	b+8(FP)
-	MOVL	DX, 0(CX)
-	RET
-
-TEXT	_addv(SB),1,$0	/* used in profiler, can't be profiled */
-	MOVL	r+0(FP), CX
-	MOVL	a+4(FP), AX
-	MOVL	a+8(FP), BX
-	ADDL	b+12(FP), AX
-	ADCL	b+16(FP), BX
-	MOVL	AX, 0(CX)
-	MOVL	BX, 4(CX)
-	RET
-
-TEXT	_subv(SB),1,$0		/* used in profiler, can't be profiled */
-	MOVL	r+0(FP), CX
-	MOVL	a+4(FP), AX
-	MOVL	a+8(FP), BX
-	SUBL	b+12(FP), AX
-	SBBL	b+16(FP), BX
-	MOVL	AX, 0(CX)
-	MOVL	BX, 4(CX)
-	RET

+ 0 - 755
sys/src/libc/386/vlrt.c

@@ -1,755 +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	unsigned long	ulong;
-typedef	unsigned int	uint;
-typedef	unsigned short	ushort;
-typedef	unsigned char	uchar;
-typedef	signed char	schar;
-
-#define	SIGN(n)	(1UL<<(n-1))
-
-typedef	struct	Vlong	Vlong;
-struct	Vlong
-{
-	union
-	{
-		struct
-		{
-			uint32_t	lo;
-			uint32_t	hi;
-		};
-		struct
-		{
-			uint16_t	lols;
-			uint16_t	loms;
-			uint16_t	hils;
-			uint16_t	hims;
-		};
-	};
-};
-
-void	abort(void);
-
-void _subv(Vlong*, Vlong, Vlong);
-
-void
-_d2v(Vlong *y, double d)
-{
-	union { double d; struct Vlong; } x;
-	uint32_t xhi, xlo, ylo, yhi;
-	int sh;
-
-	x.d = d;
-
-	xhi = (x.hi & 0xfffff) | 0x100000;
-	xlo = x.lo;
-	sh = 1075 - ((x.hi >> 20) & 0x7ff);
-
-	ylo = 0;
-	yhi = 0;
-	if(sh >= 0) {
-		/* v = (hi||lo) >> sh */
-		if(sh < 32) {
-			if(sh == 0) {
-				ylo = xlo;
-				yhi = xhi;
-			} else {
-				ylo = (xlo >> sh) | (xhi << (32-sh));
-				yhi = xhi >> sh;
-			}
-		} else {
-			if(sh == 32) {
-				ylo = xhi;
-			} else
-			if(sh < 64) {
-				ylo = xhi >> (sh-32);
-			}
-		}
-	} else {
-		/* v = (hi||lo) << -sh */
-		sh = -sh;
-		if(sh <= 10) {
-			ylo = xlo << sh;
-			yhi = (xhi << sh) | (xlo >> (32-sh));
-		} else {
-			/* overflow */
-			yhi = d;	/* causes something awful */
-		}
-	}
-	if(x.hi & SIGN(32)) {
-		if(ylo != 0) {
-			ylo = -ylo;
-			yhi = ~yhi;
-		} else
-			yhi = -yhi;
-	}
-
-	y->hi = yhi;
-	y->lo = ylo;
-}
-
-void
-_f2v(Vlong *y, float f)
-{
-
-	_d2v(y, f);
-}
-
-double
-_v2d(Vlong x)
-{
-	if(x.hi & SIGN(32)) {
-		if(x.lo) {
-			x.lo = -x.lo;
-			x.hi = ~x.hi;
-		} else
-			x.hi = -x.hi;
-		return -((int32_t)x.hi*4294967296. + x.lo);
-	}
-	return (int32_t)x.hi*4294967296. + x.lo;
-}
-
-float
-_v2f(Vlong x)
-{
-	return _v2d(x);
-}
-
-uint32_t	_div64by32(Vlong, uint32_t, uint32_t*);
-int	_mul64by32(Vlong*, Vlong, uint32_t);
-
-static void
-slowdodiv(Vlong num, Vlong den, Vlong *q, Vlong *r)
-{
-	uint32_t numlo, numhi, denhi, denlo, quohi, quolo, t;
-	int i;
-
-	numhi = num.hi;
-	numlo = num.lo;
-	denhi = den.hi;
-	denlo = den.lo;
-
-	/*
-	 * get a divide by zero
-	 */
-	if(denlo==0 && denhi==0) {
-		numlo = numlo / denlo;
-	}
-
-	/*
-	 * set up the divisor and find the number of iterations needed
-	 */
-	if(numhi >= SIGN(32)) {
-		quohi = SIGN(32);
-		quolo = 0;
-	} else {
-		quohi = numhi;
-		quolo = numlo;
-	}
-	i = 0;
-	while(denhi < quohi || (denhi == quohi && denlo < quolo)) {
-		denhi = (denhi<<1) | (denlo>>31);
-		denlo <<= 1;
-		i++;
-	}
-
-	quohi = 0;
-	quolo = 0;
-	for(; i >= 0; i--) {
-		quohi = (quohi<<1) | (quolo>>31);
-		quolo <<= 1;
-		if(numhi > denhi || (numhi == denhi && numlo >= denlo)) {
-			t = numlo;
-			numlo -= denlo;
-			if(numlo > t)
-				numhi--;
-			numhi -= denhi;
-			quolo |= 1;
-		}
-		denlo = (denlo>>1) | (denhi<<31);
-		denhi >>= 1;
-	}
-
-	if(q) {
-		q->lo = quolo;
-		q->hi = quohi;
-	}
-	if(r) {
-		r->lo = numlo;
-		r->hi = numhi;
-	}
-}
-
-static void
-dodiv(Vlong num, Vlong den, Vlong *qp, Vlong *rp)
-{
-	uint32_t n;
-	Vlong x, q, r;
-
-	if(den.hi > num.hi || (den.hi == num.hi && den.lo > num.lo)){
-		if(qp) {
-			qp->hi = 0;
-			qp->lo = 0;
-		}
-		if(rp) {
-			rp->hi = num.hi;
-			rp->lo = num.lo;
-		}
-		return;
-	}
-
-	if(den.hi != 0){
-		q.hi = 0;
-		n = num.hi/den.hi;
-		if(_mul64by32(&x, den, n) || x.hi > num.hi ||
-		    (x.hi == num.hi && x.lo > num.lo))
-			slowdodiv(num, den, &q, &r);
-		else {
-			q.lo = n;
-			_subv(&r, num, x);
-		}
-	} else {
-		if(num.hi >= den.lo){
-			q.hi = n = num.hi/den.lo;
-			num.hi -= den.lo*n;
-		} else {
-			q.hi = 0;
-		}
-		q.lo = _div64by32(num, den.lo, &r.lo);
-		r.hi = 0;
-	}
-	if(qp) {
-		qp->lo = q.lo;
-		qp->hi = q.hi;
-	}
-	if(rp) {
-		rp->lo = r.lo;
-		rp->hi = r.hi;
-	}
-}
-
-void
-_divvu(Vlong *q, Vlong n, Vlong d)
-{
-
-	if(n.hi == 0 && d.hi == 0) {
-		q->hi = 0;
-		q->lo = n.lo / d.lo;
-		return;
-	}
-	dodiv(n, d, q, 0);
-}
-
-void
-_modvu(Vlong *r, Vlong n, Vlong d)
-{
-
-	if(n.hi == 0 && d.hi == 0) {
-		r->hi = 0;
-		r->lo = n.lo % d.lo;
-		return;
-	}
-	dodiv(n, d, 0, r);
-}
-
-static void
-vneg(Vlong *v)
-{
-
-	if(v->lo == 0) {
-		v->hi = -v->hi;
-		return;
-	}
-	v->lo = -v->lo;
-	v->hi = ~v->hi;
-}
-
-void
-_divv(Vlong *q, Vlong n, Vlong d)
-{
-	int32_t nneg, dneg;
-
-	if(n.hi == (((int32_t)n.lo)>>31) && d.hi == (((int32_t)d.lo)>>31)) {
-		q->lo = (int32_t)n.lo / (int32_t)d.lo;
-		q->hi = ((int32_t)q->lo) >> 31;
-		return;
-	}
-	nneg = n.hi >> 31;
-	if(nneg)
-		vneg(&n);
-	dneg = d.hi >> 31;
-	if(dneg)
-		vneg(&d);
-	dodiv(n, d, q, 0);
-	if(nneg != dneg)
-		vneg(q);
-}
-
-void
-_modv(Vlong *r, Vlong n, Vlong d)
-{
-	int32_t nneg, dneg;
-
-	if(n.hi == (((int32_t)n.lo)>>31) && d.hi == (((int32_t)d.lo)>>31)) {
-		r->lo = (int32_t)n.lo % (int32_t)d.lo;
-		r->hi = ((int32_t)r->lo) >> 31;
-		return;
-	}
-	nneg = n.hi >> 31;
-	if(nneg)
-		vneg(&n);
-	dneg = d.hi >> 31;
-	if(dneg)
-		vneg(&d);
-	dodiv(n, d, 0, r);
-	if(nneg)
-		vneg(r);
-}
-
-void
-_rshav(Vlong *r, Vlong a, int b)
-{
-	int32_t t;
-
-	t = a.hi;
-	if(b >= 32) {
-		r->hi = t>>31;
-		if(b >= 64) {
-			/* this is illegal re C standard */
-			r->lo = t>>31;
-			return;
-		}
-		r->lo = t >> (b-32);
-		return;
-	}
-	if(b <= 0) {
-		r->hi = t;
-		r->lo = a.lo;
-		return;
-	}
-	r->hi = t >> b;
-	r->lo = (t << (32-b)) | (a.lo >> b);
-}
-
-void
-_rshlv(Vlong *r, Vlong a, int b)
-{
-	uint32_t t;
-
-	t = a.hi;
-	if(b >= 32) {
-		r->hi = 0;
-		if(b >= 64) {
-			/* this is illegal re C standard */
-			r->lo = 0;
-			return;
-		}
-		r->lo = t >> (b-32);
-		return;
-	}
-	if(b <= 0) {
-		r->hi = t;
-		r->lo = a.lo;
-		return;
-	}
-	r->hi = t >> b;
-	r->lo = (t << (32-b)) | (a.lo >> b);
-}
-
-void
-_lshv(Vlong *r, Vlong a, int b)
-{
-	uint32_t t;
-
-	t = a.lo;
-	if(b >= 32) {
-		r->lo = 0;
-		if(b >= 64) {
-			/* this is illegal re C standard */
-			r->hi = 0;
-			return;
-		}
-		r->hi = t << (b-32);
-		return;
-	}
-	if(b <= 0) {
-		r->lo = t;
-		r->hi = a.hi;
-		return;
-	}
-	r->lo = t << b;
-	r->hi = (t >> (32-b)) | (a.hi << b);
-}
-
-void
-_andv(Vlong *r, Vlong a, Vlong b)
-{
-	r->hi = a.hi & b.hi;
-	r->lo = a.lo & b.lo;
-}
-
-void
-_orv(Vlong *r, Vlong a, Vlong b)
-{
-	r->hi = a.hi | b.hi;
-	r->lo = a.lo | b.lo;
-}
-
-void
-_xorv(Vlong *r, Vlong a, Vlong b)
-{
-	r->hi = a.hi ^ b.hi;
-	r->lo = a.lo ^ b.lo;
-}
-
-void
-_vpp(Vlong *l, Vlong *r)
-{
-
-	l->hi = r->hi;
-	l->lo = r->lo;
-	r->lo++;
-	if(r->lo == 0)
-		r->hi++;
-}
-
-void
-_vmm(Vlong *l, Vlong *r)
-{
-
-	l->hi = r->hi;
-	l->lo = r->lo;
-	if(r->lo == 0)
-		r->hi--;
-	r->lo--;
-}
-
-void
-_ppv(Vlong *l, Vlong *r)
-{
-
-	r->lo++;
-	if(r->lo == 0)
-		r->hi++;
-	l->hi = r->hi;
-	l->lo = r->lo;
-}
-
-void
-_mmv(Vlong *l, Vlong *r)
-{
-
-	if(r->lo == 0)
-		r->hi--;
-	r->lo--;
-	l->hi = r->hi;
-	l->lo = r->lo;
-}
-
-void
-_vasop(Vlong *ret, void *lv, void fn(Vlong*, Vlong, Vlong), int type, Vlong rv)
-{
-	Vlong t, u;
-
-	u.lo = 0;
-	u.hi = 0;
-	switch(type) {
-	default:
-		abort();
-		break;
-
-	case 1:	/* schar */
-		t.lo = *(schar*)lv;
-		t.hi = t.lo >> 31;
-		fn(&u, t, rv);
-		*(schar*)lv = u.lo;
-		break;
-
-	case 2:	/* uchar */
-		t.lo = *(uint8_t*)lv;
-		t.hi = 0;
-		fn(&u, t, rv);
-		*(uint8_t*)lv = u.lo;
-		break;
-
-	case 3:	/* short */
-		t.lo = *(int16_t*)lv;
-		t.hi = t.lo >> 31;
-		fn(&u, t, rv);
-		*(int16_t*)lv = u.lo;
-		break;
-
-	case 4:	/* ushort */
-		t.lo = *(uint16_t*)lv;
-		t.hi = 0;
-		fn(&u, t, rv);
-		*(uint16_t*)lv = u.lo;
-		break;
-
-	case 9:	/* int */
-		t.lo = *(int*)lv;
-		t.hi = t.lo >> 31;
-		fn(&u, t, rv);
-		*(int*)lv = u.lo;
-		break;
-
-	case 10:	/* uint */
-		t.lo = *(uint*)lv;
-		t.hi = 0;
-		fn(&u, t, rv);
-		*(uint*)lv = u.lo;
-		break;
-
-	case 5:	/* long */
-		t.lo = *(int32_t*)lv;
-		t.hi = t.lo >> 31;
-		fn(&u, t, rv);
-		*(int32_t*)lv = u.lo;
-		break;
-
-	case 6:	/* ulong */
-		t.lo = *(uint32_t*)lv;
-		t.hi = 0;
-		fn(&u, t, rv);
-		*(uint32_t*)lv = u.lo;
-		break;
-
-	case 7:	/* vlong */
-	case 8:	/* uvlong */
-		fn(&u, *(Vlong*)lv, rv);
-		*(Vlong*)lv = u;
-		break;
-	}
-	*ret = u;
-}
-
-void
-_p2v(Vlong *ret, void *p)
-{
-	int32_t t;
-
-	t = (uint32_t)p;
-	ret->lo = t;
-	ret->hi = 0;
-}
-
-void
-_sl2v(Vlong *ret, int32_t sl)
-{
-	int32_t t;
-
-	t = sl;
-	ret->lo = t;
-	ret->hi = t >> 31;
-}
-
-void
-_ul2v(Vlong *ret, uint32_t ul)
-{
-	int32_t t;
-
-	t = ul;
-	ret->lo = t;
-	ret->hi = 0;
-}
-
-void
-_si2v(Vlong *ret, int si)
-{
-	int32_t t;
-
-	t = si;
-	ret->lo = t;
-	ret->hi = t >> 31;
-}
-
-void
-_ui2v(Vlong *ret, uint ui)
-{
-	int32_t t;
-
-	t = ui;
-	ret->lo = t;
-	ret->hi = 0;
-}
-
-void
-_sh2v(Vlong *ret, int32_t sh)
-{
-	int32_t t;
-
-	t = (sh << 16) >> 16;
-	ret->lo = t;
-	ret->hi = t >> 31;
-}
-
-void
-_uh2v(Vlong *ret, uint32_t ul)
-{
-	int32_t t;
-
-	t = ul & 0xffff;
-	ret->lo = t;
-	ret->hi = 0;
-}
-
-void
-_sc2v(Vlong *ret, int32_t uc)
-{
-	int32_t t;
-
-	t = (uc << 24) >> 24;
-	ret->lo = t;
-	ret->hi = t >> 31;
-}
-
-void
-_uc2v(Vlong *ret, uint32_t ul)
-{
-	int32_t t;
-
-	t = ul & 0xff;
-	ret->lo = t;
-	ret->hi = 0;
-}
-
-int32_t
-_v2sc(Vlong rv)
-{
-	int32_t t;
-
-	t = rv.lo & 0xff;
-	return (t << 24) >> 24;
-}
-
-int32_t
-_v2uc(Vlong rv)
-{
-
-	return rv.lo & 0xff;
-}
-
-int32_t
-_v2sh(Vlong rv)
-{
-	int32_t t;
-
-	t = rv.lo & 0xffff;
-	return (t << 16) >> 16;
-}
-
-int32_t
-_v2uh(Vlong rv)
-{
-
-	return rv.lo & 0xffff;
-}
-
-int32_t
-_v2sl(Vlong rv)
-{
-
-	return rv.lo;
-}
-
-int32_t
-_v2ul(Vlong rv)
-{
-
-	return rv.lo;
-}
-
-int32_t
-_v2si(Vlong rv)
-{
-
-	return rv.lo;
-}
-
-int32_t
-_v2ui(Vlong rv)
-{
-
-	return rv.lo;
-}
-
-int
-_testv(Vlong rv)
-{
-	return rv.lo || rv.hi;
-}
-
-int
-_eqv(Vlong lv, Vlong rv)
-{
-	return lv.lo == rv.lo && lv.hi == rv.hi;
-}
-
-int
-_nev(Vlong lv, Vlong rv)
-{
-	return lv.lo != rv.lo || lv.hi != rv.hi;
-}
-
-int
-_ltv(Vlong lv, Vlong rv)
-{
-	return (int32_t)lv.hi < (int32_t)rv.hi || 
-		(lv.hi == rv.hi && lv.lo < rv.lo);
-}
-
-int
-_lev(Vlong lv, Vlong rv)
-{
-	return (int32_t)lv.hi < (int32_t)rv.hi || 
-		(lv.hi == rv.hi && lv.lo <= rv.lo);
-}
-
-int
-_gtv(Vlong lv, Vlong rv)
-{
-	return (int32_t)lv.hi > (int32_t)rv.hi || 
-		(lv.hi == rv.hi && lv.lo > rv.lo);
-}
-
-int
-_gev(Vlong lv, Vlong rv)
-{
-	return (int32_t)lv.hi > (int32_t)rv.hi || 
-		(lv.hi == rv.hi && lv.lo >= rv.lo);
-}
-
-int
-_lov(Vlong lv, Vlong rv)
-{
-	return lv.hi < rv.hi || 
-		(lv.hi == rv.hi && lv.lo < rv.lo);
-}
-
-int
-_lsv(Vlong lv, Vlong rv)
-{
-	return lv.hi < rv.hi || 
-		(lv.hi == rv.hi && lv.lo <= rv.lo);
-}
-
-int
-_hiv(Vlong lv, Vlong rv)
-{
-	return lv.hi > rv.hi || 
-		(lv.hi == rv.hi && lv.lo > rv.lo);
-}
-
-int
-_hsv(Vlong lv, Vlong rv)
-{
-	return lv.hi > rv.hi || 
-		(lv.hi == rv.hi && lv.lo >= rv.lo);
-}

+ 0 - 17
sys/src/libc/9sys/abort.c

@@ -1,17 +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.
- */
-
-#include <u.h>
-#include <libc.h>
-void
-abort(void)
-{
-	while(*(int*)0)
-		;
-}

+ 1 - 1
sys/src/libc/9sys/access.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 int
 int
-access(char *name, int mode)
+access(const char *name, int mode)
 {
 {
 	int fd;
 	int fd;
 	Dir *db;
 	Dir *db;

+ 9 - 9
sys/src/libc/9sys/announce.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
-static int	nettrans(char*, char*, int na, char*, int);
+static int	nettrans(const char*, char*, int na, char*, int);
 
 
 enum
 enum
 {
 {
@@ -22,7 +22,7 @@ enum
  *  announce a network service.
  *  announce a network service.
  */
  */
 int
 int
-announce(char *addr, char *dir)
+announce(const char *addr, char *dir)
 {
 {
 	int ctl, n, m;
 	int ctl, n, m;
 	char buf[Maxpath];
 	char buf[Maxpath];
@@ -89,7 +89,7 @@ announce(char *addr, char *dir)
  *  listen for an incoming call
  *  listen for an incoming call
  */
  */
 int
 int
-listen(char *dir, char *newdir)
+listen(const char *dir, char *newdir)
 {
 {
 	int ctl, n, m;
 	int ctl, n, m;
 	char buf[Maxpath];
 	char buf[Maxpath];
@@ -141,10 +141,10 @@ listen(char *dir, char *newdir)
  *  accept a call, return an fd to the open data file
  *  accept a call, return an fd to the open data file
  */
  */
 int
 int
-accept(int ctl, char *dir)
+accept(int ctl, const char *dir)
 {
 {
 	char buf[Maxpath];
 	char buf[Maxpath];
-	char *num;
+	const char *num;
 	int32_t n;
 	int32_t n;
 
 
 	num = strrchr(dir, '/');
 	num = strrchr(dir, '/');
@@ -164,10 +164,10 @@ accept(int ctl, char *dir)
  *  reject a call, tell device the reason for the rejection
  *  reject a call, tell device the reason for the rejection
  */
  */
 int
 int
-reject(int ctl, char *dir, char *cause)
+reject(int ctl, const char *dir, const char *cause)
 {
 {
 	char buf[Maxpath];
 	char buf[Maxpath];
-	char *num;
+	const char *num;
 	int32_t n;
 	int32_t n;
 
 
 	num = strrchr(dir, '/');
 	num = strrchr(dir, '/');
@@ -186,7 +186,7 @@ reject(int ctl, char *dir, char *cause)
  *  perform the identity translation (in case we can't reach cs)
  *  perform the identity translation (in case we can't reach cs)
  */
  */
 static int
 static int
-identtrans(char *netdir, char *addr, char *naddr, int na,
+identtrans(char *netdir, const char *addr, char *naddr, int na,
 	   char *file, int nf)
 	   char *file, int nf)
 {
 {
 	char proto[Maxpath];
 	char proto[Maxpath];
@@ -212,7 +212,7 @@ identtrans(char *netdir, char *addr, char *naddr, int na,
  *  call up the connection server and get a translation
  *  call up the connection server and get a translation
  */
  */
 static int
 static int
-nettrans(char *addr, char *naddr, int na, char *file, int nf)
+nettrans(const char *addr, char *naddr, int na, char *file, int nf)
 {
 {
 	int i, fd;
 	int i, fd;
 	char buf[Maxpath];
 	char buf[Maxpath];

+ 6 - 6
sys/src/libc/9sys/dial.c

@@ -38,7 +38,7 @@ struct DS {
 	char	*rem;
 	char	*rem;
 
 
 	/* other args */
 	/* other args */
-	char	*local;
+	const char	*local;
 	char	*dir;
 	char	*dir;
 	int	*cfdp;
 	int	*cfdp;
 };
 };
@@ -74,14 +74,14 @@ struct Dest {
 
 
 static int	call(char*, char*, DS*, Dest*, Conn*);
 static int	call(char*, char*, DS*, Dest*, Conn*);
 static int	csdial(DS*);
 static int	csdial(DS*);
-static void	_dial_string_parse(char*, DS*);
+static void	_dial_string_parse(const char*, DS*);
 
 
 
 
 /*
 /*
  *  the dialstring is of the form '[/net/]proto!dest'
  *  the dialstring is of the form '[/net/]proto!dest'
  */
  */
 static int
 static int
-dialimpl(char *dest, char *local, char *dir, int *cfdp)
+dialimpl(const char *dest, const char *local, char *dir, int *cfdp)
 {
 {
 	DS ds;
 	DS ds;
 	int rv;
 	int rv;
@@ -123,10 +123,10 @@ dialimpl(char *dest, char *local, char *dir, int *cfdp)
  * the thread library can't cope with rfork(RFMEM|RFPROC),
  * the thread library can't cope with rfork(RFMEM|RFPROC),
  * so it must override this with a private version of dial.
  * so it must override this with a private version of dial.
  */
  */
-int (*_dial)(char *, char *, char *, int *) = dialimpl;
+int (*_dial)(const char *, const char *, char *, int *) = dialimpl;
 
 
 int
 int
-dial(char *dest, char *local, char *dir, int *cfdp)
+dial(const char *dest, const char *local, char *dir, int *cfdp)
 {
 {
 	return (*_dial)(dest, local, dir, cfdp);
 	return (*_dial)(dest, local, dir, cfdp);
 }
 }
@@ -530,7 +530,7 @@ call(char *clone, char *dest, DS *ds, Dest *dp, Conn *conn)
  *  parse a dial string
  *  parse a dial string
  */
  */
 static void
 static void
-_dial_string_parse(char *str, DS *ds)
+_dial_string_parse(const char *str, DS *ds)
 {
 {
 	char *p, *p2;
 	char *p, *p2;
 
 

+ 1 - 1
sys/src/libc/9sys/dirstat.c

@@ -17,7 +17,7 @@ enum
 };
 };
 
 
 Dir*
 Dir*
-dirstat(char *name)
+dirstat(const char *name)
 {
 {
 	Dir *d;
 	Dir *d;
 	uint8_t *buf;
 	uint8_t *buf;

+ 1 - 1
sys/src/libc/9sys/dirwstat.c

@@ -12,7 +12,7 @@
 #include <fcall.h>
 #include <fcall.h>
 
 
 int
 int
-dirwstat(char *name, Dir *d)
+dirwstat(const char *name, Dir *d)
 {
 {
 	uint8_t *buf;
 	uint8_t *buf;
 	int r;
 	int r;

+ 2 - 2
sys/src/libc/9sys/getenv.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 char*
 char*
-getenv(char *name)
+getenv(const char *name)
 {
 {
 	int r, f;
 	int r, f;
 	int32_t s;
 	int32_t s;
@@ -29,7 +29,7 @@ getenv(char *name)
 	s = seek(f, 0, 2);
 	s = seek(f, 0, 2);
 	ans = malloc(s+1);
 	ans = malloc(s+1);
 	if(ans) {
 	if(ans) {
-		setmalloctag(ans, getcallerpc(&name));
+		setmalloctag(ans, getcallerpc());
 		seek(f, 0, 0);
 		seek(f, 0, 0);
 		r = read(f, ans, s);
 		r = read(f, ans, s);
 		if(r >= 0) {
 		if(r >= 0) {

+ 1 - 1
sys/src/libc/9sys/getnetconninfo.c

@@ -45,7 +45,7 @@ getendpoint(char *dir, char *file, char **sysp, char **servp)
 }
 }
 
 
 NetConnInfo*
 NetConnInfo*
-getnetconninfo(char *dir, int fd)
+getnetconninfo(const char *dir, int fd)
 {
 {
 	NetConnInfo *nci;
 	NetConnInfo *nci;
 	char *cp;
 	char *cp;

+ 0 - 85
sys/src/libc/9sys/nsec.c

@@ -1,85 +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.
- */
-
-#include <u.h>
-#include <libc.h>
-#include <tos.h>
-
-static uint64_t order = 0x0001020304050607ULL;
-
-static void
-be2vlong(int64_t *to, uint8_t *f)
-{
-	uint8_t *t, *o;
-	int i;
-
-	t = (uint8_t*)to;
-	o = (uint8_t*)&order;
-	for(i = 0; i < sizeof order; i++)
-		t[o[i]] = f[i];
-}
-
-static int fd = -1;
-static struct {
-	int	pid;
-	int	fd;
-} fds[64];
-
-int64_t
-nsec(void)
-{
-	uint8_t b[8];
-	int64_t t;
-	int pid, i, f, tries;
-
-	/*
-	 * Threaded programs may have multiple procs
-	 * with different fd tables, so we may need to open
-	 * /dev/bintime on a per-pid basis
-	 */
-
-	/* First, look if we've opened it for this particular pid */
-	if((pid = _tos->pid) == 0)		/* 9vx bug, perhaps? */
-		_tos->pid = pid = getpid();
-	do{
-		f = -1;
-		for(i = 0; i < nelem(fds); i++)
-			if(fds[i].pid == pid){
-				f = fds[i].fd;
-				break;
-			}
-		tries = 0;
-		if(f < 0){
-			/* If it's not open for this pid, try the global pid */
-			if(fd >= 0)
-				f = fd;
-			else{
-				/* must open */
-				if((f = open("/dev/bintime", OREAD|OCEXEC)) < 0)
-					return 0;
-				fd = f;
-				for(i = 0; i < nelem(fds); i++)
-					if(fds[i].pid == pid || fds[i].pid == 0){
-						fds[i].pid = pid;
-						fds[i].fd = f;
-						break;
-					}
-			}
-		}
-		if(pread(f, b, sizeof b, 0) == sizeof b){
-			be2vlong(&t, b);
-			return t;
-		}
-		close(f);
-		if(i < nelem(fds))
-			fds[i].fd = -1;
-	}while(tries++ == 0);	/* retry once */
-	USED(tries);
-	return 0;
-}

+ 1 - 1
sys/src/libc/9sys/postnote.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 int
 int
-postnote(int group, int pid, char *note)
+postnote(int group, int pid, const char *note)
 {
 {
 	char file[128];
 	char file[128];
 	int f, r;
 	int f, r;

+ 1 - 1
sys/src/libc/9sys/pushssl.c

@@ -17,7 +17,7 @@
  */
  */
 
 
 int
 int
-pushssl(int fd, char *alg, char *secin, char *secout, int *cfd)
+pushssl(int fd, const char *alg, const char *secin, const char *secout, int *cfd)
 {
 {
 	char buf[8];
 	char buf[8];
 	char dname[64];
 	char dname[64];

+ 2 - 2
sys/src/libc/9sys/pushtls.c

@@ -48,8 +48,8 @@ finished(int hand, int isclient)
 
 
 // given a plain fd and secrets established beforehand, return encrypted connection
 // given a plain fd and secrets established beforehand, return encrypted connection
 int
 int
-pushtls(int fd, char *hashalg, char *encalg, int isclient,
-	char *secret, char *dir)
+pushtls(int fd, const char *hashalg, const char *encalg, int isclient,
+	const char *secret, char *dir)
 {
 {
 	char buf[8];
 	char buf[8];
 	char dname[64];
 	char dname[64];

+ 1 - 1
sys/src/libc/9sys/putenv.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 int
 int
-putenv(char *name, char *val)
+putenv(const char *name, const char *val)
 {
 {
 	int f;
 	int f;
 	char ename[100];
 	char ename[100];

+ 3 - 2
sys/src/libc/9sys/qlock.c

@@ -93,7 +93,7 @@ qunlock(QLock *q)
 	lock(&q->lock);
 	lock(&q->lock);
 	if (q->locked == 0)
 	if (q->locked == 0)
 		fprint(2, "qunlock called with qlock not held, from %#p\n",
 		fprint(2, "qunlock called with qlock not held, from %#p\n",
-			getcallerpc(&q));
+			getcallerpc());
 	p = q->head;
 	p = q->head;
 	if(p != nil){
 	if(p != nil){
 		/* wakeup head waiting process */
 		/* wakeup head waiting process */
@@ -208,7 +208,7 @@ wlock(RWLock *q)
 		return;
 		return;
 	}
 	}
 
 
-	/* wait */
+	/* chain into waiting list */
 	p = q->tail;
 	p = q->tail;
 	mp = getqlp();
 	mp = getqlp();
 	if(p == nil)
 	if(p == nil)
@@ -223,6 +223,7 @@ wlock(RWLock *q)
 	/* wait in kernel */
 	/* wait in kernel */
 	while((*_rendezvousp)(mp, (void*)1) == (void*)~0)
 	while((*_rendezvousp)(mp, (void*)1) == (void*)~0)
 		;
 		;
+
 	mp->inuse = 0;
 	mp->inuse = 0;
 }
 }
 
 

+ 21 - 18
sys/src/libc/9sys/read.c

@@ -1,26 +1,29 @@
 /*
 /*
- * This file is part of Harvey.
- *
- * Copyright (C) 2015 Giacomo Tesio <giacomo@tesio.it>	
- *
- * Harvey is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2 of the License.
- *
- * Harvey is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Harvey.  If not, see <http://www.gnu.org/licenses/>.
+ * 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.
  */
  */
 
 
 #include <u.h>
 #include <u.h>
 #include <libc.h>
 #include <libc.h>
 
 
-int32_t
-read(int fd, void* buf, int32_t nbytes)
+ssize_t
+read(int d, void *buf, size_t nbytes)
 {
 {
-	return pread(fd, buf, nbytes, ~0LL);
+	int n;
+
+	if(nbytes <= 0)
+		return 0;
+	if(buf == 0){
+		sysfatal("read failed: %r");
+	}
+
+	n = pread(d, buf, nbytes, ~0LL);
+	if(n < 0)
+		sysfatal("read failed: %r");;
+
+	return n;
 }
 }

+ 1 - 1
sys/src/libc/9sys/setnetmtpt.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 void
 void
-setnetmtpt(char *net, int n, char *x)
+setnetmtpt(char *net, int n, const char *x)
 {
 {
 	if(x == nil)
 	if(x == nil)
 		x = "/net";
 		x = "/net";

+ 3 - 3
sys/src/libc/9sys/sysfatal.c

@@ -12,7 +12,7 @@
 
 
 
 
 static void
 static void
-_sysfatalimpl(char *fmt, va_list arg)
+_sysfatalimpl(const char *fmt, va_list arg)
 {
 {
 	char buf[1024];
 	char buf[1024];
 
 
@@ -24,10 +24,10 @@ _sysfatalimpl(char *fmt, va_list arg)
 	exits(buf);
 	exits(buf);
 }
 }
 
 
-void (*_sysfatal)(char *fmt, va_list arg) = _sysfatalimpl;
+void (*_sysfatal)(const char *fmt, va_list arg) = _sysfatalimpl;
 
 
 void
 void
-sysfatal(char *fmt, ...)
+sysfatal(const char *fmt, ...)
 {
 {
 	va_list arg;
 	va_list arg;
 
 

+ 1 - 1
sys/src/libc/9sys/syslog.c

@@ -49,7 +49,7 @@ eqdirdev(Dir *a, Dir *b)
  * If cons or log file can't be opened, print on the system console, too.
  * If cons or log file can't be opened, print on the system console, too.
  */
  */
 void
 void
-syslog(int cons, char *logname, char *fmt, ...)
+syslog(int cons, const char *logname, const char *fmt, ...)
 {
 {
 	char buf[1024];
 	char buf[1024];
 	char *ctim, *p;
 	char *ctim, *p;

+ 1 - 1
sys/src/libc/9sys/werrstr.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 #include <libc.h>
 
 
 void
 void
-werrstr(char *fmt, ...)
+werrstr(const char *fmt, ...)
 {
 {
 	va_list arg;
 	va_list arg;
 	char buf[ERRMAX];
 	char buf[ERRMAX];

+ 14 - 18
sys/src/libc/9sys/write.c

@@ -1,26 +1,22 @@
 /*
 /*
- * This file is part of Harvey.
- *
- * Copyright (C) 2015 Giacomo Tesio <giacomo@tesio.it>	
- *
- * Harvey is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2 of the License.
- *
- * Harvey is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Harvey.  If not, see <http://www.gnu.org/licenses/>.
+ * 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.
  */
  */
 
 
 #include <u.h>
 #include <u.h>
 #include <libc.h>
 #include <libc.h>
 
 
-int32_t
-write(int fd, const void* buf, int32_t nbytes)
+ssize_t
+write(int d, const void *buf, size_t nbytes)
 {
 {
-	return pwrite(fd, buf, nbytes, ~0LL);
+	int n;
+
+	n = pwrite(d, buf, nbytes, ~0LL);
+	if(n < 0)
+		sysfatal("write failed: %r");
+	return n;
 }
 }

+ 0 - 1
sys/src/libc/9syscall/9syscall.json

@@ -1,6 +1,5 @@
 {
 {
 	"KernelLibc": {
 	"KernelLibc": {
-		"Library": "klibc.a",
 		"Pre": [
 		"Pre": [
 			"mksys -o sys.h -mode=sys.h /sys/src/sysconf.json",
 			"mksys -o sys.h -mode=sys.h /sys/src/sysconf.json",
 			"mksys -o . -mode=syscallfiles /sys/src/sysconf.json"
 			"mksys -o . -mode=syscallfiles /sys/src/sysconf.json"

+ 0 - 4
sys/src/libc/amd64/9asm/argv0.s

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

+ 0 - 66
sys/src/libc/amd64/9asm/atom.s

@@ -1,66 +0,0 @@
-TEXT ainc(SB), 1, $0	/* long ainc(long *); */
-ainclp:
-	MOVL	(RARG), AX	/* exp */
-	MOVL	AX, BX
-	INCL	BX		/* new */
-	LOCK; CMPXCHGL BX, (RARG)
-	JNZ	ainclp
-	MOVL	BX, AX
-	RET
-
-TEXT adec(SB), 1, $0	/* long adec(long*); */
-adeclp:
-	MOVL	(RARG), AX
-	MOVL	AX, BX
-	DECL	BX
-	LOCK; CMPXCHGL BX, (RARG)
-	JNZ	adeclp
-	MOVL	BX, AX
-	RET
-
-/*
- * int cas32(u32int *p, u32int ov, u32int nv);
- * int cas(uint *p, int ov, int nv);
- * int casul(ulong *p, ulong ov, ulong nv);
- */
-
-TEXT cas32(SB), 1, $0
-TEXT cas(SB), 1, $0
-TEXT casul(SB), 1, $0
-TEXT casl(SB), 1, $0			/* back compat */
-	MOVL	exp+8(FP), AX
-	MOVL	new+16(FP), BX
-	LOCK; CMPXCHGL BX, (RARG)
-	MOVL	$1, AX				/* use CMOVLEQ etc. here? */
-	JNZ	_cas32r0
-_cas32r1:
-	RET
-_cas32r0:
-	DECL	AX
-	RET
-
-/*
- * int cas64(u64int *p, u64int ov, u64int nv);
- * int casp(void **p, void *ov, void *nv);
- */
-
-TEXT cas64(SB), 1, $0
-TEXT casp(SB), 1, $0
-	MOVQ	exp+8(FP), AX
-	MOVQ	new+16(FP), BX
-	LOCK; CMPXCHGQ BX, (RARG)
-	MOVL	$1, AX				/* use CMOVLEQ etc. here? */
-	JNZ	_cas64r0
-_cas64r1:
-	RET
-_cas64r0:
-	DECL	AX
-	RET
-
-/*
- * void mfence(void);
- */
-TEXT mfence(SB),0,$0
-	MFENCE
-	RET
-

+ 0 - 5
sys/src/libc/amd64/9asm/cycles.s

@@ -1,5 +0,0 @@
-TEXT cycles(SB),1,$0				/* time stamp counter; cycles since power up */
-	RDTSC
-	MOVL	AX, 0(RARG)			/* lo */
-	MOVL	DX, 4(RARG)			/* hi */
-	RET

+ 0 - 3
sys/src/libc/amd64/9asm/getcallerpc.s

@@ -1,3 +0,0 @@
-TEXT getcallerpc(SB), $0
-	MOVQ	-8(RARG), AX
-	RET

+ 0 - 38
sys/src/libc/amd64/9asm/getfcr.s

@@ -1,38 +0,0 @@
-
-TEXT	setfcr(SB), $4
-	XORL	$(0x3F<<7),RARG	/* bits are cleared in csr to enable them */
-	ANDL	$0xFFC0, RARG	/* just the fcr bits */
-	WAIT	/* is this needed? */
-	STMXCSR	0(SP)
-	MOVL	0(SP), AX
-	ANDL	$~0x3F, AX
-	ORL	RARG, AX
-	MOVL	AX, 0(SP)
-	LDMXCSR	0(SP)
-	RET
-
-TEXT	getfcr(SB), $4
-	WAIT
-	STMXCSR	0(SP)
-	MOVWLZX	0(SP), AX
-	ANDL	$0xFFC0, AX
-	XORL	$(0x3F<<7),AX
-	RET
-
-TEXT	getfsr(SB), $4
-	WAIT
-	STMXCSR	0(SP)
-	MOVL	0(SP), AX
-	ANDL	$0x3F, AX
-	RET
-
-TEXT	setfsr(SB), $4
-	ANDL	$0x3F, RARG
-	WAIT
-	STMXCSR	0(SP)
-	MOVL	0(SP), AX
-	ANDL	$~0x3F, AX
-	ORL	RARG, AX
-	MOVL	AX, 0(SP)
-	LDMXCSR	0(SP)
-	RET

+ 0 - 19
sys/src/libc/amd64/9asm/main9.s

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

+ 0 - 41
sys/src/libc/amd64/9asm/main9p.s

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

Some files were not shown because too many files changed in this diff