History

20090612-1932

Charles.Forsyth committed 17 years ago

Commit 6703a071 parent f9de9827 files · +89 −49Browse files

Unified · Split

7 files
  1. CHANGES +2 −0
  2. emu/Linux/asm-power.S +65 −43
  3. emu/Linux/segflush-power.c +1 −1
  4. include/version.h +1 −1
  5. lib/proto/inferno +4 −0
  6. lib9/getcallerpc-Linux-power.c +12 −0
  7. libinterp/das-power.c +4 −4
CHANGES+2−0
@@ -1,3 +1,5 @@
1+200090612
2+ added support for Linux-power (ericvh; and further simplified)
13 20090605
24 appl/cmd/disk/kfs.b dis/disk/kfs.dis - don't try to update super block if readonly(!) [issue 175]
35 20090526
emu/Linux/asm-power.S+65−43
@@ -1,57 +1,80 @@
1−#include <asm-ppc/reg.h>
2−
3− .file "asm-power.S"
4− .section ".text"
5− .align 2
6− .globl FPsave
7− .type FPsave, @function
1+ .align 2
2+ .global FPsave
83 FPsave:
9− .set _framesize,0
10− mffs f0
11− stfd f0,0(r3)
4+ stfd %f14,0*8(%r3)
5+ stfd %f15,1*8(%r3)
6+ stfd %f16,2*8(%r3)
7+ stfd %f17,3*8(%r3)
8+ stfd %f18,4*8(%r3)
9+ stfd %f19,5*8(%r3)
10+ stfd %f20,6*8(%r3)
11+ stfd %f21,7*8(%r3)
12+ stfd %f22,8*8(%r3)
13+ stfd %f23,9*8(%r3)
14+ stfd %f24,10*8(%r3)
15+ stfd %f25,11*8(%r3)
16+ stfd %f26,12*8(%r3)
17+ stfd %f27,13*8(%r3)
18+ stfd %f28,14*8(%r3)
19+ stfd %f29,15*8(%r3)
20+ stfd %f30,16*8(%r3)
21+ stfd %f31,17*8(%r3)
1222 blr
13− .size FPsave,.-FPsave
1423
15− .align 2
16− .globl FPrestore
24+ .align 2
25+ .global FPrestore
1726 FPrestore:
18− lfd f0,0(r3)
19− mtfsf 0xff,f0
27+ lfd %f14,0*8(%r3)
28+ lfd %f15,1*8(%r3)
29+ lfd %f16,2*8(%r3)
30+ lfd %f17,3*8(%r3)
31+ lfd %f18,4*8(%r3)
32+ lfd %f19,5*8(%r3)
33+ lfd %f20,6*8(%r3)
34+ lfd %f21,7*8(%r3)
35+ lfd %f22,8*8(%r3)
36+ lfd %f23,9*8(%r3)
37+ lfd %f24,10*8(%r3)
38+ lfd %f25,11*8(%r3)
39+ lfd %f26,12*8(%r3)
40+ lfd %f27,13*8(%r3)
41+ lfd %f28,14*8(%r3)
42+ lfd %f29,15*8(%r3)
43+ lfd %f30,16*8(%r3)
44+ lfd %f31,17*8(%r3)
2045 blr
21− .size FPrestore, .-FPrestore
2246
23− .align 2
24− .globl _tas
47+ .align 2
48+ .global _tas
2549 _tas:
2650 sync
27− mr r4,r3
28− addi r5,0,0x1
51+ mr %r4, %r3
52+ addi %r5,0,0x1
2953 1:
30− lwarx r3,0,r4
31− cmpwi r3,0x0
32− bne- 2f
33− stwcx. r5,0,r4
34− bne- 1b /* Lost reservation, try again */
54+ lwarx %r3, 0, %r4
55+ cmpwi %r3, 0
56+ bne- 2f
57+ stwcx. %r5, 0, %r4
58+ bne- 1b
3559 2:
3660 sync
3761 blr
38− .size _tas,.-_tas
3962
4063 /*
41− * void executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg)
64+ * void
65+ * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg)
4266 */
4367 .align 2
44− .globl executeonnewstack:
68+ .global executeonnewstack
4569 executeonnewstack:
46− mr r1,r3 /* change stacks */
47− stwu 1,-16(r1) /* save lr to aid the traceback */
48− li r0,0
49− stw r0,20(r1)
50− mr r3,r5
51− mtctr r4
52− bctrl /* tramp(arg) */
53− br . /* failed */
54− .size executeonnewstack,.-executeonnewstack
70+ mr %r1,%r3 /* change stacks */
71+ stwu %lr,-16(%r1) /* save lr to aid the traceback */
72+ li %r0,0
73+ stw %r0,20(%r1)
74+ mr %r3,%r5
75+ mtctr %r4
76+ bctrl /* tramp(arg) */
77+ br
5578
5679 /*
5780 * void unlockandexit(int *key)
@@ -63,10 +86,9 @@ executeonnewstack: · 5 unmodified lines
6386 .align 2
6487 .globl unlockandexit
6588 unlockandexit:
66− li r0,0x0
67− stw r0,0(r3) /* unlock */
68− li r0,1 /* sys exit; 234 is exit group */
69− li r3,0 /* exit status */
89+ li %r0,0x0
90+ stw %r0,0(%r3) /* unlock */
91+ li %r0,1 /* sys exit; 234 is exit group */
92+ li %r3,0 /* exit status */
7093 sc
71− br . /* not reached */
72− .size unlockandexit,.-unlockandexit
94+ br
emu/Linux/segflush-power.c+1−1
@@ -16,7 +16,7 @@ segflush(void *a, ulong n) · 15 unmodified lines
1616
1717 // cache blocks are often eight words (32 bytes) long, sometimes 16 bytes.
1818 // need to determine it dynamically?
19− for (p = (ulong *)((ulong)a & ~3UL); (char *)p < (char *)a + n; p++)
19+ for (p = (ulong *)((ulong)a & ~7UL); (char *)p < (char *)a + n; p++)
2020 __asm__("dcbst 0,%0\n\t" // not dcbf, which writes back, then invalidates
2121 "icbi 0,%0\n\t"
2222 : // no output
include/version.h+1−1
@@ -1 +1 @@
1−#define VERSION "Fourth Edition (20090605)"
1+#define VERSION "Fourth Edition (20090612)"
lib/proto/inferno+4−0
@@ -25,6 +25,10 @@ Linux · 24 unmodified lines
2525 bin
2626 include
2727 lib
28+ power
29+ bin
30+ include
31+ lib
2832 spim
2933 bin
3034 include
lib9/getcallerpc-Linux-power.c+12−0
@@ -0,0 +1,12 @@
1+#include <lib9.h>
2+
3+ulong
4+getcallerpc(void *x)
5+{
6+ulong *lp;
7+
8+ lp = x;
9+
10+ return lp[-1];
11+}
12+
libinterp/das-power.c+4−4
@@ -413,7 +413,7 @@ sub(Opcode *o, Instr *i) · 412 unmodified lines
413413 }
414414
415415 static void
416−div(Opcode *o, Instr *i)
416+idiv(Opcode *o, Instr *i)
417417 {
418418 format(o->mnemonic, i, 0);
419419 if(i->op == 31)
@@ -554,8 +554,8 @@ static Opcode opcodes[] = { · 134 unmodified lines
554554 {31, 246, ALL, "DCBTST", dcb, 0},
555555 {31, 1014, ALL, "DCBZ", dcb, 0},
556556
557− {31, 491, OEM, "DIVW%V%C", div, ir3},
558− {31, 459, OEM, "DIVWU%V%C", div, ir3},
557+ {31, 491, OEM, "DIVW%V%C", idiv, ir3},
558+ {31, 459, OEM, "DIVWU%V%C", idiv, ir3},
559559
560560 {31, 310, ALL, "ECIWX", ldx, 0},
561561 {31, 438, ALL, "ECOWX", stx, 0},
@@ -647,7 +647,7 @@ static Opcode opcodes[] = { · 85 unmodified lines
647647 {31, 242, ALL, "MOVW", gen, "R%s,SEG(R%b)"},
648648
649649 {31, 235, OEM, "MULLW%V%C", gencc, ir3},
650− {7, 0, 0, "MULLW", div, "%i,R%a,R%d"},
650+ {7, 0, 0, "MULLW", idiv, "%i,R%a,R%d"},
651651
652652 {31, 476, ALL, "NAND%C", gencc, il3},
653653 {31, 104, OEM, "NEG%V%C", neg, ir2},