commit 87ad8a9b47ba374a46d05341536e78f23b6af238
parent f106a51f85c7b8c5e013c0e93c34269f7b68e259
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Fri, 10 Sep 2010 23:36:08 +0200
AUTOGEN...
Diffstat:
8 files changed, 8 insertions(+), 203 deletions(-)
diff --git a/src/9vx/a/AUTOGEN b/src/9vx/a/AUTOGEN
@@ -27,7 +27,6 @@ autofiles="
/sys/include/trace.h
/sys/src/9/pc/dat.h
/sys/src/9/pc/devether.c
-/sys/src/9/pc/errstr.h
/sys/src/9/pc/etherif.h
/sys/src/9/pc/fns.h
/sys/src/9/pc/io.h
@@ -130,6 +129,7 @@ do
test -f $ed && echo ' ('$ed')' || echo
test -f $out && chmod +w $out
(
+ echo ',s;"../ip/;"ip/;g'
echo ',s;"../port/;";g'
echo ',s;#include.*<;#include ";g'
echo ',s;#include.*>;&FIXINCLUDEME;g'
diff --git a/src/9vx/a/devproc.ed b/src/9vx/a/devproc.ed
@@ -27,28 +27,14 @@ g/real time/d
/if(s->flushme)/d
d
,s/MACHP(0)->ticks/msec()/g
-/Qprofile,/a
- Qsyscall,
-.
/{Qprofile}/a
"syscall", {Qsyscall}, 0, 0400,
.
/^profclock/;#
/^{/+1,/^}/-1d
/^procopen/;#
-/case Qfpregs/a
- case Qsyscall:
-.
/^procread/;#
/Confmem/d
-/case Qmem/i
- case Qsyscall:
- if(!p->syscalltrace)
- return 0;
- n = readstr(offset, a, n, p->syscalltrace);
- return n;
-
-.
/KZERO/ s/KZERO/USTKTOP/
+2,/case .*:/-1c
error("no kernel memory access");
diff --git a/src/9vx/a/fault.ed b/src/9vx/a/fault.ed
@@ -47,17 +47,15 @@ void*
qunlock(&s->lk);
return up->pmmu.uzero+addr0;
.
-/^validaddr/-1;+1 c
+/^validaddr/-1;/^}/ c
void*
uvalidaddr(ulong addr, ulong len, int write)
-.
-/okaddr/c
+{
void *v;
v = okaddr(addr, len, write);
if(v == nil)
-.
-/Suicide/a
+ pexit("Suicide", 0);
// This is a valid address, but the host kernel
// might not know that. In case we're going
@@ -78,6 +76,7 @@ uvalidaddr(ulong addr, ulong len, int write)
(void)a[len-1];
}
return v;
+}
.
/^vmemchr/ s/^//
/int m/ s/m/m_/
diff --git a/src/9vx/a/fns.ed b/src/9vx/a/fns.ed
@@ -1,6 +1,7 @@
g/bios32/d
g/Pcidev/d
g/mfence/d
+g/syscallprint/d
$a
// Plan 9 VX additions
diff --git a/src/9vx/a/libsec.ed b/src/9vx/a/libsec.ed
@@ -1 +1,2 @@
,s,u32int,uint32,g
+,s,u64int,uint64,g
diff --git a/src/9vx/a/portdat.ed b/src/9vx/a/portdat.ed
@@ -32,10 +32,6 @@ v/typedef/ s/RWlock;/RWlock lk;/g
v/typedef/ s/Timer;/Timer timer;/g
/Notsave;/ s/Notsave;/Notsave notsave;/
,s/PMMU;/PMMU pmmu;/g
-/PMMU/a
- /* syscall trace */
- char *syscalltrace;
-.
$a
void printmap(void); // Plan 9 VX
diff --git a/src/9vx/a/portfns.ed b/src/9vx/a/portfns.ed
@@ -43,3 +43,4 @@ void plimitproc(void*);
void ploadproc(void*);
.
g/ยต/d
+/ realloc/d
diff --git a/src/9vx/a/sysfile.ed b/src/9vx/a/sysfile.ed
@@ -13,186 +13,7 @@
// Plan 9 VX replaced dodgy varargs code
v = *(vlong*)&arg[3];
.
-/^bindmount/ s/int ismount/int isk, int ismount/
-.-1i
- // Plan 9 VX added isk parameter.
-.
-,s/return bindmount(/return bindmount(0, /g
g/^sys_/ s/ulong \*)/ulong *u)/
-/^bindmount/,/^sysbind/ s/validaddr/if(!isk) validaddr/
-/^bindmount/,/^sysbind/ s/spec = validnamedup/if(isk) kstrdup(\&spec, spec); else &/
-g/^[a-z]/ s/ulong/uint32/g
-/^openmode/ s/uint32/ulong/
-/^sysfd2path/ s/^//
-/validaddr/-1;+1c
- char *buf;
-
- buf = uvalidaddr(arg[1], arg[2], 1);
-.
-/snprint/ s/(char\*)arg\[1\]/buf/
-/^syspipe/ s/^//
-/validaddr/-1;+1c
- int *ufd;
-
- ufd = uvalidaddr(arg[0], 2*BY2WD, 1);
-.
-/((long\*)arg\[0\])/ s/((long\*)arg\[0\])/ufd/
-/((long\*)arg\[0\])/ s/((long\*)arg\[0\])/ufd/
-/^sysopen/ s/^//
-/^$/i
- char *name;
-.
-/openmode/a
- name = uvalidaddr(arg[0], 1, 0);
- c = namec(name, Aopen, arg[1], 0);
-.
-/if(c)/d
-s/ //
-/validaddr/;/c = namec/d
-/^doread/ s/^//
-/^{/a
- int dir;
-.
-/validaddr/;/p =/c
- p = uvalidaddr(arg[1], n, 1);
-.
-/QTDIR/;/c->umh/c
- dir = c->qid.type&QTDIR;
- if(dir && mountrockread(c, p, n, &nn)){
- /* do nothing: mountrockread filled buffer */
- }else{
- if(dir && c->umh)
-.
-/else{/;/}/c
- else
- nn = devtab[c->type]->read(c, p, n, off);
- }
- if(dir)
-.
-/}else/;/nnn/c
- else
- nnn = nn;
-.
-/^dowrite/ s/^//
-/^$/i
- uchar *p;
-.
-/validaddr/ s/v/p = uv/
-/m = devtab/ s/(void\*)arg\[1\]/p/
-/^sseek/s/(/(vlong *ret, /
-/u\[2\]/ s/ulong/uint32/
-/arg\[0\] = off/ s/\*(vlong\*)arg\[0\]/*ret/
-/^sysseek/s/^//
-/validaddr/;/sseek/c
- sseek(uvalidaddr(arg[0], BY2V, 1), arg);
-.
-/^sysoseek/s/^//
-/^{/;/^$/s/ulong/uint32/g
-/a\[0\]/ s/=.*/= 0;/
-/sseek/ s/(.*)/(\&o.v, a)/
-/^sysfstat/ s/^//
-/^$/i
- uchar *p;
-.
-/validaddr/ s/v/p = uv/
-/l = devtab/ s/(.*)/(c, p, l)/
-/^sysstat/ s/^//
-/^$/i
- uchar *p;
-.
-/validaddr/ s/v/p = uv/
-/validaddr/ s/v/name = uv/
-/c = namec/ s/(char\*)arg\[0\]/name/
-/l = devtab/ s/(.*)/(c, p, l)/
-/l = dirsetname/ s/(uchar\*)arg\[1\]/p/
-/^syschdir/ s/^//
-/^$/i
- char *name;
-.
-/validaddr/ s/v/name = uv/
-/c = namec/ s/(char\*)arg\[0\]/name/
-/^bindmount/ s/int isk, //
-s/uint32/ulong/
-/isk/d
-/isk/s/if.*else //
-/isk/d
-/isk/d
-/^sysbind/ s/^//
-/return/ s/0, //
-s/(char\*)arg\[0\]/uvalidaddr(arg[0], 1, 0)/
-s/(char\*)arg\[1\]/uvalidaddr(arg[1], 1, 0)/
-/^sysmount/ s/^//
-/return/ s/0, //
-s/(char\*)arg\[2\]/uvalidaddr(arg[2], 1, 0)/
-s/(char\*)arg\[4\]/uvalidaddr(arg[4], 1, 0)/
-/^sys_mount/ s/^//
-/return/ s/0, //
-s/(char\*)arg\[1\]/uvalidaddr(arg[1], 1, 0)/
-s/(char\*)arg\[3\]/uvalidaddr(arg[3], 1, 0)/
-/^sysunmount/ s/^//
-/^$/i
- char *mount, *mounted;
-.
-/validaddr/;/cmount/c
- mount = uvalidaddr(arg[1], 1, 0);
- cmount = namec(mount, Amount, 0, 0);
-.
-/validaddr/ s/v/mounted = uv/
-/cmounted/ s/(char\*)arg\[0\]/mounted/
-/^syscreate/ s/^//
-/^$/i
- char *name;
-.
-/validaddr/;/c = namec/c
- name = uvalidaddr(arg[0], 1, 0);
- c = namec(name, Acreate, arg[1], arg[2]);
-.
-/^sysremove/ s/^//
-/^$/i
- char *name;
-.
-/validaddr/;/c = namec/c
- name = uvalidaddr(arg[0], 1, 0);
- c = namec(name, Aremove, 0, 0);
-.
-/^syswstat/ s/^//
-/^$/i
- char *name;
- uchar *p;
-.
-/validaddr/;/return/c
- p = uvalidaddr(arg[1], l, 0);
- validstat(p, l);
- name = uvalidaddr(arg[0], 1, 0);
- c = namec(name, Aaccess, 0, 0);
- return wstat(c, p, l);
-.
-/^sysfwstat/ s/^//
-/^$/i
- uchar *p;
-.
-/validaddr/ s/v/p = uv/
-/validstat/ s/(uchar\*)arg\[1\]/p/
-/return/ s/(uchar\*)arg\[1\]/p/
-/^sys_stat/ s/^//
-/name/ s/;/, *elem;/
-/^$/i
- uchar *p;
-.
-/validaddr/;/namec/c
- p = uvalidaddr(arg[1], 116, 1);
- name = uvalidaddr(arg[0], 1, 0);
- c = namec(name, Aaccess, 0, 0);
-.
-/name =/;/l =/ s/name/elem/g
-/dirsetelem/ s/elem/name/
-/packoldstat/ s/(uchar\*)arg\[1\]/p/
-/^sys_fstat/ s/^//
-/^$/i
- uchar *p;
-.
-/validaddr/ s/v/p = uv/
-/packoldstat/ s/(uchar\*)arg\[1\]/p/
$a
// Plan 9 VX additions