[inferno-npe] push by extrudedaluminiu - Switch Plan 9 386 code to use portable incref/decref. Allows building ... on 2010-08-02 20:54 GMT

2 views
Skip to first unread message

infer...@googlecode.com

unread,
Aug 2, 2010, 4:54:51 PM8/2/10
to inferno-n...@googlegroups.com
Revision: ea28542fe0
Author: Venkatesh Srinivas <venk...@sensorstar.com>
Date: Mon Aug 2 13:54:38 2010
Log: Switch Plan 9 386 code to use portable incref/decref. Allows building
on Plan9
again.
http://code.google.com/p/inferno-npe/source/detail?r=ea28542fe0

Modified:
/emu/Plan9/asm-386.s
/emu/Plan9/os-386.c

=======================================
--- /emu/Plan9/asm-386.s Fri Jan 15 06:06:15 2010
+++ /emu/Plan9/asm-386.s Mon Aug 2 13:54:38 2010
@@ -31,10 +31,3 @@
MOVL fpu+0(FP), AX
FLDENV 0(AX)
RET
-
-
-TEXT _xadd(SB), $0 /* long _xadd(long *, long) */
- MOVL v+4(FP), AX
- MOVL p+0(FP), BX
- LOCK; XADDW AX, (BX)
- RET
=======================================
--- /emu/Plan9/os-386.c Thu Jan 14 14:19:51 2010
+++ /emu/Plan9/os-386.c Mon Aug 2 13:54:38 2010
@@ -1,22 +1,1 @@
-#include "dat.h"
-#include "fns.h"
-
-int _xadd(ulong *, int);
-
-int
-incref(Ref *r)
-{
- return _xadd(&r->ref, 1) + 1;
-}
-
-int
-decref(Ref *r)
-{
- int x;
-
- x = _xadd(&r->ref, -1) - 1;
- if (x < 0)
- panic("decref, pc=0x%lux", getcallerpc(&r));
-
- return x;
-}
+#include "os-mips.c"

Reply all
Reply to author
Forward
0 new messages