History

20100213-2114

forsyth committed 16 years ago

Commit 591b8a31 parent 3161f1d8 files · +129 −10Browse files

Unified · Split

8 files
  1. CHANGES +2 −0
  2. emu/port/devfs-posix.c +1 −4
  3. include/version.h +1 −1
  4. libkern/div-thumb.s +119 −0
  5. libkern/mkfile-thumb +1 −0
  6. mkfiles/mkfile-os-thumb +3 −3
  7. os/port/portmkfile +1 −1
  8. utils/5l/span.c +1 −1
CHANGES+2−0
@@ -1,3 +1,5 @@
120100213
2 apply saoret.one's changes for thumb [issue 155]
120100205320100205
2 update man pages to replace most references to Styx by 9P4 update man pages to replace most references to Styx by 9P
3 update man pages to replace references to sys-dial(2) by dial(2)5 update man pages to replace references to sys-dial(2) by dial(2)
emu/port/devfs-posix.c+1−4
@@ -750,7 +750,7 @@ fsdirread(Chan *c, uchar *va, int count, vlong offset) · 749 unmodified lines
750 struct stat stbuf;750 struct stat stbuf;
751 char path[MAXPATH], *ep;751 char path[MAXPATH], *ep;
752 struct dirent *de;752 struct dirent *de;
753 static char slop[8192];753 static uchar slop[8192];
754 754
755 i = 0;755 i = 0;
756 fspath(FS(c)->name, "", path);756 fspath(FS(c)->name, "", path);
@@ -951,7 +951,6 @@ static User* · 194 unmodified lines
951newuname(char *name)951newuname(char *name)
952{952{
953 struct passwd *p;953 struct passwd *p;
954 User *u;
955 954
956 p = getpwnam(name);955 p = getpwnam(name);
957 if(p == nil)956 if(p == nil)
@@ -963,7 +962,6 @@ static User* · 5 unmodified lines
963newuid(int id)962newuid(int id)
964{963{
965 struct passwd *p;964 struct passwd *p;
966 User *u;
967 965
968 p = getpwuid(id);966 p = getpwuid(id);
969 if(p == nil)967 if(p == nil)
@@ -1010,7 +1008,6 @@ newgname(char *name) · 40 unmodified lines
1010static User*1008static User*
1011id2user(User **tab, int id, User* (*get)(int))1009id2user(User **tab, int id, User* (*get)(int))
1012{1010{
1013 int i;
1014 User *u, **h;1011 User *u, **h;
1015 1012
1016 h = hashuser(tab, id);1013 h = hashuser(tab, id);
include/version.h+1−1
@@ -1 +1 @@
1#define VERSION "Fourth Edition (20100209)"1#define VERSION "Fourth Edition (20100213)"
libkern/div-thumb.s+119−0
@@ -0,0 +1,119 @@
1Q = 0
2N = 1
3D = 2
4CC = 3
5TMP = 11
6
7TEXT save<>(SB), 1, $0
8 MOVW R(Q), 0(FP)
9 MOVW R(N), 4(FP)
10 MOVW R(D), 8(FP)
11 MOVW R(CC), 12(FP)
12
13 MOVW R(TMP), R(Q) /* numerator */
14 MOVW 20(FP), R(D) /* denominator */
15 CMP $0, R(D)
16 BNE s1
17 SWI 0
18/* MOVW -1(R(D)), R(TMP) /* divide by zero fault */
19s1: RET
20
21TEXT rest<>(SB), 1, $0
22 MOVW 0(FP), R(Q)
23 MOVW 4(FP), R(N)
24 MOVW 8(FP), R(D)
25 MOVW 12(FP), R(CC)
26/*
27 * return to caller
28 * of rest<>
29 */
30 MOVW 0(R13), R14
31 ADD $20, R13
32 B (R14)
33
34TEXT div<>(SB), 1, $0
35 MOVW $32, R(CC)
36/*
37 * skip zeros 8-at-a-time
38 */
39e1:
40 AND.S $(0xff<<24),R(Q), R(N)
41 BNE e2
42 SLL $8, R(Q)
43 SUB.S $8, R(CC)
44 BNE e1
45 RET
46e2:
47 MOVW $0, R(N)
48
49loop:
50/*
51 * shift R(N||Q) left one
52 */
53 SLL $1, R(N)
54 CMP $0, R(Q)
55 ORR.LT $1, R(N)
56 SLL $1, R(Q)
57
58/*
59 * compare numerator to denominator
60 * if less, subtract and set quotent bit
61 */
62 CMP R(D), R(N)
63 ORR.HS $1, R(Q)
64 SUB.HS R(D), R(N)
65 SUB.S $1, R(CC)
66 BNE loop
67 RET
68
69TEXT _div(SB), 1, $16
70 BL save<>(SB)
71 CMP $0, R(Q)
72 BGE d1
73 RSB $0, R(Q), R(Q)
74 CMP $0, R(D)
75 BGE d2
76 RSB $0, R(D), R(D)
77d0:
78 BL div<>(SB) /* none/both neg */
79 MOVW R(Q), R(TMP)
80 B out
81d1:
82 CMP $0, R(D)
83 BGE d0
84 RSB $0, R(D), R(D)
85d2:
86 BL div<>(SB) /* one neg */
87 RSB $0, R(Q), R(TMP)
88 B out
89
90TEXT _mod(SB), 1, $16
91 BL save<>(SB)
92 CMP $0, R(D)
93 RSB.LT $0, R(D), R(D)
94 CMP $0, R(Q)
95 BGE m1
96 RSB $0, R(Q), R(Q)
97 BL div<>(SB) /* neg numerator */
98 RSB $0, R(N), R(TMP)
99 B out
100m1:
101 BL div<>(SB) /* pos numerator */
102 MOVW R(N), R(TMP)
103 B out
104
105TEXT _divu(SB), 1, $16
106 BL save<>(SB)
107 BL div<>(SB)
108 MOVW R(Q), R(TMP)
109 B out
110
111TEXT _modu(SB), 1, $16
112 BL save<>(SB)
113 BL div<>(SB)
114 MOVW R(N), R(TMP)
115 B out
116
117out:
118 BL rest<>(SB)
119 B out
libkern/mkfile-thumb+1−0
@@ -10,3 +10,4 @@ TARGFILES=\ · 9 unmodified lines
10 strchr-thumb.$O\10 strchr-thumb.$O\
11 vlop-thumb.$O\11 vlop-thumb.$O\
12 vlrt-thumb.$O\12 vlrt-thumb.$O\
13 div-thumb.$O\
mkfiles/mkfile-os-thumb+3−3
@@ -1,7 +1,7 @@
1TARGMODEL= Inferno1TARGMODEL= Inferno
2TARGSHTYPE= sh2TARGSHTYPE= sh
3CPUS= arm3CPUS= arm
4OBJDIR= Inferno/arm #force everything to point to inferno directory4OBJDIR= Inferno/thumb #force everything to point to inferno directory
5 5
6O= t6O= t
7OS= 5t7OS= 5t
@@ -11,10 +11,10 @@ ARFLAGS= vu · 3 unmodified lines
11ARPREFIX=11ARPREFIX=
12 12
13AS= 5a13AS= 5a
14ASFLAGS=14ASFLAGS= -t
15 15
16CC= tc16CC= tc
17CFLAGS= -wFV -I$ROOT/Inferno/arm/include -I$ROOT/include17CFLAGS= -wFV -I$ROOT/Inferno/thumb/include -I$ROOT/include
18ANSICPP= -p18ANSICPP= -p
19 19
20LD= 5l20LD= 5l
os/port/portmkfile+1−1
@@ -9,7 +9,7 @@ LIBFILES=${LIBS:%=$ROOT/Inferno/$OBJTYPE/lib/lib%.a} · 8 unmodified lines
9CLEANEXTRA=9CLEANEXTRA=
10 10
11%.$O: %.s11%.$O: %.s
12 $AS $stem.s12 $AS $ASFLAGS $stem.s
13 13
14%.$O: %.c14%.$O: %.c
15 $CC $CFLAGS $stem.c15 $CC $CFLAGS $stem.c
utils/5l/span.c+1−1
@@ -266,7 +266,7 @@ span(void) · 265 unmodified lines
266 266
267 loop:267 loop:
268 passes++;268 passes++;
269 if(passes > 100){269 if(passes > 150){
270 diag("span looping !");270 diag("span looping !");
271 errorexit();271 errorexit();
272 }272 }