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 @@
1200090612
2 added support for Linux-power (ericvh; and further simplified)
120090605320090605
2 appl/cmd/disk/kfs.b dis/disk/kfs.dis - don't try to update super block if readonly(!) [issue 175]4 appl/cmd/disk/kfs.b dis/disk/kfs.dis - don't try to update super block if readonly(!) [issue 175]
320090526520090526
emu/Linux/asm-power.S+65−43
@@ -1,57 +1,80 @@
1#include <asm-ppc/reg.h>1 .align 2
2 2 .global FPsave
3 .file "asm-power.S"
4 .section ".text"
5 .align 2
6 .globl FPsave
7 .type FPsave, @function
8FPsave:3FPsave:
9 .set _framesize,04 stfd %f14,0*8(%r3)
10 mffs f05 stfd %f15,1*8(%r3)
11 stfd f0,0(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)
12 blr22 blr
13 .size FPsave,.-FPsave
14 23
15 .align 224 .align 2
16 .globl FPrestore25 .global FPrestore
17FPrestore:26FPrestore:
18 lfd f0,0(r3)27 lfd %f14,0*8(%r3)
19 mtfsf 0xff,f028 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)
20 blr45 blr
21 .size FPrestore, .-FPrestore
22 46
23 .align 247 .align 2
24 .globl _tas48 .global _tas
25_tas:49_tas:
26 sync50 sync
27 mr r4,r351 mr %r4, %r3
28 addi r5,0,0x152 addi %r5,0,0x1
291:531:
30 lwarx r3,0,r454 lwarx %r3, 0, %r4
31 cmpwi r3,0x055 cmpwi %r3, 0
32 bne- 2f56 bne- 2f
33 stwcx. r5,0,r457 stwcx. %r5, 0, %r4
34 bne- 1b /* Lost reservation, try again */58 bne- 1b
352:592:
36 sync60 sync
37 blr61 blr
38 .size _tas,.-_tas
39 62
40/*63/*
41 * void executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg)64 * void
65 * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg)
42 */66 */
43 .align 267 .align 2
44 .globl executeonnewstack:68 .global executeonnewstack
45executeonnewstack:69executeonnewstack:
46 mr r1,r3 /* change stacks */70 mr %r1,%r3 /* change stacks */
47 stwu 1,-16(r1) /* save lr to aid the traceback */71 stwu %lr,-16(%r1) /* save lr to aid the traceback */
48 li r0,072 li %r0,0
49 stw r0,20(r1)73 stw %r0,20(%r1)
50 mr r3,r574 mr %r3,%r5
51 mtctr r475 mtctr %r4
52 bctrl /* tramp(arg) */76 bctrl /* tramp(arg) */
53 br . /* failed */77 br
54 .size executeonnewstack,.-executeonnewstack
55 78
56/*79/*
57 * void unlockandexit(int *key)80 * void unlockandexit(int *key)
@@ -63,10 +86,9 @@ executeonnewstack: · 5 unmodified lines
63 .align 286 .align 2
64 .globl unlockandexit87 .globl unlockandexit
65unlockandexit:88unlockandexit:
66 li r0,0x089 li %r0,0x0
67 stw r0,0(r3) /* unlock */90 stw %r0,0(%r3) /* unlock */
68 li r0,1 /* sys exit; 234 is exit group */91 li %r0,1 /* sys exit; 234 is exit group */
69 li r3,0 /* exit status */92 li %r3,0 /* exit status */
70 sc93 sc
71 br . /* not reached */94 br
72 .size unlockandexit,.-unlockandexit
emu/Linux/segflush-power.c+1−1
@@ -16,7 +16,7 @@ segflush(void *a, ulong n) · 15 unmodified lines
16 16
17 // cache blocks are often eight words (32 bytes) long, sometimes 16 bytes.17 // cache blocks are often eight words (32 bytes) long, sometimes 16 bytes.
18 // need to determine it dynamically?18 // 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++)
20 __asm__("dcbst 0,%0\n\t" // not dcbf, which writes back, then invalidates20 __asm__("dcbst 0,%0\n\t" // not dcbf, which writes back, then invalidates
21 "icbi 0,%0\n\t"21 "icbi 0,%0\n\t"
22 : // no output22 : // 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
25 bin25 bin
26 include26 include
27 lib27 lib
28 power
29 bin
30 include
31 lib
28 spim32 spim
29 bin33 bin
30 include34 include
lib9/getcallerpc-Linux-power.c+12−0
@@ -0,0 +1,12 @@
1#include <lib9.h>
2
3ulong
4getcallerpc(void *x)
5{
6ulong *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
413}413}
414 414
415static void415static void
416div(Opcode *o, Instr *i)416idiv(Opcode *o, Instr *i)
417{417{
418 format(o->mnemonic, i, 0);418 format(o->mnemonic, i, 0);
419 if(i->op == 31)419 if(i->op == 31)
@@ -554,8 +554,8 @@ static Opcode opcodes[] = { · 134 unmodified lines
554 {31, 246, ALL, "DCBTST", dcb, 0},554 {31, 246, ALL, "DCBTST", dcb, 0},
555 {31, 1014, ALL, "DCBZ", dcb, 0},555 {31, 1014, ALL, "DCBZ", dcb, 0},
556 556
557 {31, 491, OEM, "DIVW%V%C", div, ir3},557 {31, 491, OEM, "DIVW%V%C", idiv, ir3},
558 {31, 459, OEM, "DIVWU%V%C", div, ir3},558 {31, 459, OEM, "DIVWU%V%C", idiv, ir3},
559 559
560 {31, 310, ALL, "ECIWX", ldx, 0},560 {31, 310, ALL, "ECIWX", ldx, 0},
561 {31, 438, ALL, "ECOWX", stx, 0},561 {31, 438, ALL, "ECOWX", stx, 0},
@@ -647,7 +647,7 @@ static Opcode opcodes[] = { · 85 unmodified lines
647 {31, 242, ALL, "MOVW", gen, "R%s,SEG(R%b)"},647 {31, 242, ALL, "MOVW", gen, "R%s,SEG(R%b)"},
648 648
649 {31, 235, OEM, "MULLW%V%C", gencc, ir3},649 {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"},
651 651
652 {31, 476, ALL, "NAND%C", gencc, il3},652 {31, 476, ALL, "NAND%C", gencc, il3},
653 {31, 104, OEM, "NEG%V%C", neg, ir2},653 {31, 104, OEM, "NEG%V%C", neg, ir2},