3 new revisions:
Revision: c7c827ecce
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 17:37:48 2010
Log: Add Sys->MCACHE to mount and devprog via new '-j' option; remove mcp
a...
http://code.google.com/p/inferno-npe/source/detail?r=c7c827ecce
Revision: 9cb180d907
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 17:43:26 2010
Log: Propagate CCACHE flag along channels in devmnt.
http://code.google.com/p/inferno-npe/source/detail?r=9cb180d907
Revision: 09a2e71961
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 18:40:11 2010
Log: Implement deferred clunk for cached devmnt mounts; clunks are
carried ...
http://code.google.com/p/inferno-npe/source/detail?r=09a2e71961
==============================================================================
Revision: c7c827ecce
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 17:37:48 2010
Log: Add Sys->MCACHE to mount and devprog via new '-j' option; remove mcp
and link from Chan structure.
http://code.google.com/p/inferno-npe/source/detail?r=c7c827ecce
Modified:
/MacOSX/power/bin/data2c
/MacOSX/power/bin/iyacc
/MacOSX/power/bin/mk
/MacOSX/power/bin/mkext
/appl/cmd/mount.b
/emu/port/chan.c
/emu/port/dat.h
/emu/port/dev.c
/emu/port/devprog.c
/libinterp/runt.h
=======================================
--- /MacOSX/power/bin/data2c Fri Dec 22 16:30:12 2006
+++ /MacOSX/power/bin/data2c Tue Oct 26 17:37:48 2010
Binary file, no diff available.
=======================================
--- /MacOSX/power/bin/iyacc Wed Jul 23 12:40:37 2008
+++ /MacOSX/power/bin/iyacc Tue Oct 26 17:37:48 2010
Binary file, no diff available.
=======================================
--- /MacOSX/power/bin/mk Fri Dec 22 16:30:12 2006
+++ /MacOSX/power/bin/mk Tue Oct 26 17:37:48 2010
Binary file, no diff available.
=======================================
--- /MacOSX/power/bin/mkext Sat Dec 30 13:29:14 2006
+++ /MacOSX/power/bin/mkext Tue Oct 26 17:37:48 2010
Binary file, no diff available.
=======================================
--- /appl/cmd/mount.b Tue Dec 15 13:40:20 2009
+++ /appl/cmd/mount.b Tue Oct 26 17:37:48 2010
@@ -48,7 +48,7 @@
nomod(Arg->PATH);
arg->init(args);
- arg->setusage("mount [-a|-b] [-coA9] [-C cryptoalg] [-k keyfile] [-q]
net!addr|file|{command} mountpoint [spec]");
+ arg->setusage("mount [-a|-b] [-cjoA9] [-C cryptoalg] [-k keyfile] [-q]
net!addr|file|{command} mountpoint [spec]");
flags := 0;
while((o := arg->opt()) != 0){
case o {
@@ -58,6 +58,8 @@
flags |= Sys->MBEFORE;
'c' =>
flags |= Sys->MCREATE;
+ 'j' =>
+ flags |= Sys->MCACHE;
'C' =>
alg = arg->earg();
'k' or
=======================================
--- /emu/port/chan.c Mon May 10 15:52:41 2010
+++ /emu/port/chan.c Tue Oct 26 17:37:48 2010
@@ -155,7 +155,6 @@
error(Enomem);
lock(&chanalloc.l);
c->fid = ++chanalloc.fid;
- c->link = chanalloc.list;
chanalloc.list = c;
n_chans++;
n_active_chans++;
@@ -175,7 +174,6 @@
c->dri = 0;
c->aux = 0;
c->mchan = 0;
- c->mcp = 0;
c->mux = 0;
c->mqid.path = 0;
c->mqid.vers = 0;
=======================================
--- /emu/port/dat.h Mon May 10 15:52:41 2010
+++ /emu/port/dat.h Tue Oct 26 17:37:48 2010
@@ -9,7 +9,6 @@
typedef struct Evalue Evalue;
typedef struct Fgrp Fgrp;
typedef struct Mount Mount;
-typedef struct Mntcache Mntcache;
typedef struct Mntparam Mntparam;
typedef struct Mntrpc Mntrpc;
typedef struct Mntwalk Mntwalk;
@@ -114,7 +113,6 @@
Lock l;
Ref r;
Chan* next; /* allocation */
- Chan* link;
vlong offset; /* in file */
ushort type;
ulong dev;
@@ -129,7 +127,6 @@
int uri; /* union read index */
int dri; /* devdirread index */
ulong mountid;
- Mntcache *mcp; /* Mount cache pointer */
Mnt *mux; /* Mnt for clients using me for messages */
void* aux; /* device specific data */
Chan* mchan; /* channel to mounted server */
=======================================
--- /emu/port/dev.c Tue Dec 18 01:44:28 2007
+++ /emu/port/dev.c Tue Oct 26 17:37:48 2010
@@ -111,7 +111,6 @@
nc->mountid = c->mountid;
nc->aux = c->aux;
nc->mqid = c->mqid;
- nc->mcp = c->mcp;
return nc;
}
=======================================
--- /emu/port/devprog.c Fri Dec 22 09:07:39 2006
+++ /emu/port/devprog.c Tue Oct 26 17:37:48 2010
@@ -802,7 +802,7 @@
if(flag & MCREATE)
*s++ = 'c';
if(flag & MCACHE)
- *s++ = 'C';
+ *s++ = 'j';
*s = '\0';
}
=======================================
--- /libinterp/runt.h Wed Feb 10 08:58:28 2010
+++ /libinterp/runt.h Tue Oct 26 17:37:48 2010
@@ -19,27 +19,16 @@
typedef struct Prefab_Element Prefab_Element;
typedef struct Prefab_Compound Prefab_Compound;
typedef struct Tk_Toplevel Tk_Toplevel;
-typedef struct Keyring_IPint Keyring_IPint;
-typedef struct Keyring_SigAlg Keyring_SigAlg;
-typedef struct Keyring_PK Keyring_PK;
-typedef struct Keyring_SK Keyring_SK;
-typedef struct Keyring_Certificate Keyring_Certificate;
-typedef struct Keyring_DigestState Keyring_DigestState;
-typedef struct Keyring_AESstate Keyring_AESstate;
-typedef struct Keyring_DESstate Keyring_DESstate;
-typedef struct Keyring_IDEAstate Keyring_IDEAstate;
-typedef struct Keyring_RC4state Keyring_RC4state;
-typedef struct Keyring_BFstate Keyring_BFstate;
-typedef struct Keyring_Authinfo Keyring_Authinfo;
-typedef struct Keyring_RSApk Keyring_RSApk;
-typedef struct Keyring_RSAsk Keyring_RSAsk;
-typedef struct Keyring_RSAsig Keyring_RSAsig;
-typedef struct Keyring_DSApk Keyring_DSApk;
-typedef struct Keyring_DSAsk Keyring_DSAsk;
-typedef struct Keyring_DSAsig Keyring_DSAsig;
-typedef struct Keyring_EGpk Keyring_EGpk;
-typedef struct Keyring_EGsk Keyring_EGsk;
-typedef struct Keyring_EGsig Keyring_EGsig;
+typedef struct IPints_IPint IPints_IPint;
+typedef struct Crypt_DigestState Crypt_DigestState;
+typedef struct Crypt_AESstate Crypt_AESstate;
+typedef struct Crypt_DESstate Crypt_DESstate;
+typedef struct Crypt_IDEAstate Crypt_IDEAstate;
+typedef struct Crypt_RC4state Crypt_RC4state;
+typedef struct Crypt_BFstate Crypt_BFstate;
+typedef struct Crypt_PK Crypt_PK;
+typedef struct Crypt_SK Crypt_SK;
+typedef struct Crypt_PKsig Crypt_PKsig;
typedef struct Loader_Inst Loader_Inst;
typedef struct Loader_Typedesc Loader_Typedesc;
typedef struct Loader_Link Loader_Link;
@@ -280,158 +269,136 @@
#define Tk_Toplevel_wreq_map {0x80,}
#define Tk_Toplevel_size 32
#define Tk_Toplevel_map {0xf0,}
-struct Keyring_IPint
+struct IPints_IPint
{
WORD x;
};
-#define Keyring_IPint_size 4
-#define Keyring_IPint_map {0}
-struct Keyring_SigAlg
-{
- String* name;
-};
-#define Keyring_SigAlg_size 4
-#define Keyring_SigAlg_map {0x80,}
-struct Keyring_PK
-{
- Keyring_SigAlg* sa;
- String* owner;
-};
-#define Keyring_PK_size 8
-#define Keyring_PK_map {0xc0,}
-struct Keyring_SK
-{
- Keyring_SigAlg* sa;
- String* owner;
-};
-#define Keyring_SK_size 8
-#define Keyring_SK_map {0xc0,}
-struct Keyring_Certificate
-{
- Keyring_SigAlg* sa;
- String* ha;
- String* signer;
- WORD exp;
-};
-#define Keyring_Certificate_size 16
-#define Keyring_Certificate_map {0xe0,}
-struct Keyring_DigestState
+#define IPints_IPint_size 4
+#define IPints_IPint_map {0}
+struct Crypt_DigestState
{
WORD x;
};
-#define Keyring_DigestState_size 4
-#define Keyring_DigestState_map {0}
-struct Keyring_AESstate
+#define Crypt_DigestState_size 4
+#define Crypt_DigestState_map {0}
+struct Crypt_AESstate
{
WORD x;
};
-#define Keyring_AESstate_size 4
-#define Keyring_AESstate_map {0}
-struct Keyring_DESstate
+#define Crypt_AESstate_size 4
+#define Crypt_AESstate_map {0}
+struct Crypt_DESstate
{
WORD x;
};
-#define Keyring_DESstate_size 4
-#define Keyring_DESstate_map {0}
-struct Keyring_IDEAstate
+#define Crypt_DESstate_size 4
+#define Crypt_DESstate_map {0}
+struct Crypt_IDEAstate
{
WORD x;
};
-#define Keyring_IDEAstate_size 4
-#define Keyring_IDEAstate_map {0}
-struct Keyring_RC4state
+#define Crypt_IDEAstate_size 4
+#define Crypt_IDEAstate_map {0}
+struct Crypt_RC4state
{
WORD x;
};
-#define Keyring_RC4state_size 4
-#define Keyring_RC4state_map {0}
-struct Keyring_BFstate
+#define Crypt_RC4state_size 4
+#define Crypt_RC4state_map {0}
+struct Crypt_BFstate
{
WORD x;
};
-#define Keyring_BFstate_size 4
-#define Keyring_BFstate_map {0}
-struct Keyring_Authinfo
-{
- Keyring_SK* mysk;
- Keyring_PK* mypk;
- Keyring_Certificate* cert;
- Keyring_PK* spk;
- Keyring_IPint* alpha;
- Keyring_IPint* p;
+#define Crypt_BFstate_size 4
+#define Crypt_BFstate_map {0}
+#define Crypt_PK_RSA 0
+#define Crypt_PK_Elgamal 1
+#define Crypt_PK_DSA 2
+struct Crypt_PK
+{
+ int pick;
+ union{
+ struct{
+ IPints_IPint* n;
+ IPints_IPint* ek;
+ } RSA;
+ struct{
+ IPints_IPint* p;
+ IPints_IPint* alpha;
+ IPints_IPint* key;
+ } Elgamal;
+ struct{
+ IPints_IPint* p;
+ IPints_IPint* q;
+ IPints_IPint* alpha;
+ IPints_IPint* key;
+ } DSA;
+ } u;
};
-#define Keyring_Authinfo_size 24
-#define Keyring_Authinfo_map {0xfc,}
-struct Keyring_RSApk
-{
- Keyring_IPint* n;
- Keyring_IPint* ek;
+#define Crypt_PK_RSA_size 12
+#define Crypt_PK_RSA_map {0x60,}
+#define Crypt_PK_Elgamal_size 16
+#define Crypt_PK_Elgamal_map {0x70,}
+#define Crypt_PK_DSA_size 20
+#define Crypt_PK_DSA_map {0x78,}
+#define Crypt_SK_RSA 0
+#define Crypt_SK_Elgamal 1
+#define Crypt_SK_DSA 2
+struct Crypt_SK
+{
+ int pick;
+ union{
+ struct{
+ Crypt_PK* pk;
+ IPints_IPint* dk;
+ IPints_IPint* p;
+ IPints_IPint* q;
+ IPints_IPint* kp;
+ IPints_IPint* kq;
+ IPints_IPint* c2;
+ } RSA;
+ struct{
+ Crypt_PK* pk;
+ IPints_IPint* secret;
+ } Elgamal;
+ struct{
+ Crypt_PK* pk;
+ IPints_IPint* secret;
+ } DSA;
+ } u;
};
-#define Keyring_RSApk_size 8
-#define Keyring_RSApk_map {0xc0,}
-struct Keyring_RSAsk
-{
- Keyring_RSApk* pk;
- Keyring_IPint* dk;
- Keyring_IPint* p;
- Keyring_IPint* q;
- Keyring_IPint* kp;
- Keyring_IPint* kq;
- Keyring_IPint* c2;
+#define Crypt_SK_RSA_size 32
+#define Crypt_SK_RSA_map {0x7f,}
+#define Crypt_SK_Elgamal_size 12
+#define Crypt_SK_Elgamal_map {0x60,}
+#define Crypt_SK_DSA_size 12
+#define Crypt_SK_DSA_map {0x60,}
+#define Crypt_PKsig_RSA 0
+#define Crypt_PKsig_Elgamal 1
+#define Crypt_PKsig_DSA 2
+struct Crypt_PKsig
+{
+ int pick;
+ union{
+ struct{
+ IPints_IPint* n;
+ } RSA;
+ struct{
+ IPints_IPint* r;
+ IPints_IPint* s;
+ } Elgamal;
+ struct{
+ IPints_IPint* r;
+ IPints_IPint* s;
+ } DSA;
+ } u;
};
-#define Keyring_RSAsk_size 28
-#define Keyring_RSAsk_map {0xfe,}
-struct Keyring_RSAsig
-{
- Keyring_IPint* n;
-};
-#define Keyring_RSAsig_size 4
-#define Keyring_RSAsig_map {0x80,}
-struct Keyring_DSApk
-{
- Keyring_IPint* p;
- Keyring_IPint* q;
- Keyring_IPint* alpha;
- Keyring_IPint* key;
-};
-#define Keyring_DSApk_size 16
-#define Keyring_DSApk_map {0xf0,}
-struct Keyring_DSAsk
-{
- Keyring_DSApk* pk;
- Keyring_IPint* secret;
-};
-#define Keyring_DSAsk_size 8
-#define Keyring_DSAsk_map {0xc0,}
-struct Keyring_DSAsig
-{
- Keyring_IPint* r;
- Keyring_IPint* s;
-};
-#define Keyring_DSAsig_size 8
-#define Keyring_DSAsig_map {0xc0,}
-struct Keyring_EGpk
-{
- Keyring_IPint* p;
- Keyring_IPint* alpha;
- Keyring_IPint* key;
-};
-#define Keyring_EGpk_size 12
-#define Keyring_EGpk_map {0xe0,}
-struct Keyring_EGsk
-{
- Keyring_EGpk* pk;
- Keyring_IPint* secret;
-};
-#define Keyring_EGsk_size 8
-#define Keyring_EGsk_map {0xc0,}
-struct Keyring_EGsig
-{
- Keyring_IPint* r;
- Keyring_IPint* s;
-};
-#define Keyring_EGsig_size 8
-#define Keyring_EGsig_map {0xc0,}
+#define Crypt_PKsig_RSA_size 8
+#define Crypt_PKsig_RSA_map {0x40,}
+#define Crypt_PKsig_Elgamal_size 12
+#define Crypt_PKsig_Elgamal_map {0x60,}
+#define Crypt_PKsig_DSA_size 12
+#define Crypt_PKsig_DSA_map {0x60,}
struct Loader_Inst
{
BYTE op;
@@ -3139,65 +3106,40 @@
#define Math_RND_PINF 512
#define Math_RND_Z 768
#define Math_RND_MASK 768
-void IPint_add(void*);
-typedef struct F_IPint_add F_IPint_add;
-struct F_IPint_add
+void IPints_DSAprimes(void*);
+typedef struct F_IPints_DSAprimes F_IPints_DSAprimes;
+struct F_IPints_DSAprimes
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ struct{ IPints_IPint* t0; IPints_IPint* t1; Array* t2; }* ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
};
-void Keyring_aescbc(void*);
-typedef struct F_Keyring_aescbc F_Keyring_aescbc;
-struct F_Keyring_aescbc
+void IPint_add(void*);
+typedef struct F_IPint_add F_IPint_add;
+struct F_IPint_add
{
WORD regs[NREG-1];
- WORD noret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_AESstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_aessetup(void*);
-typedef struct F_Keyring_aessetup F_Keyring_aessetup;
-struct F_Keyring_aessetup
-{
- WORD regs[NREG-1];
- Keyring_AESstate** ret;
- uchar temps[12];
- Array* key;
- Array* ivec;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_and(void*);
typedef struct F_IPint_and F_IPint_and;
struct F_IPint_and
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
-};
-void Keyring_auth(void*);
-typedef struct F_Keyring_auth F_Keyring_auth;
-struct F_Keyring_auth
-{
- WORD regs[NREG-1];
- struct{ String* t0; Array* t1; }* ret;
- uchar temps[12];
- Sys_FD* fd;
- Keyring_Authinfo* info;
- WORD setid;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_b64toip(void*);
typedef struct F_IPint_b64toip F_IPint_b64toip;
struct F_IPint_b64toip
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
String* str;
};
@@ -3206,7 +3148,7 @@
struct F_IPint_bebytestoip
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
Array* mag;
};
@@ -3217,57 +3159,17 @@
WORD regs[NREG-1];
WORD* ret;
uchar temps[12];
- Keyring_IPint* i;
-};
-void Keyring_blowfishcbc(void*);
-typedef struct F_Keyring_blowfishcbc F_Keyring_blowfishcbc;
-struct F_Keyring_blowfishcbc
-{
- WORD regs[NREG-1];
- WORD noret;
- uchar temps[12];
- Keyring_BFstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_blowfishsetup(void*);
-typedef struct F_Keyring_blowfishsetup F_Keyring_blowfishsetup;
-struct F_Keyring_blowfishsetup
-{
- WORD regs[NREG-1];
- Keyring_BFstate** ret;
- uchar temps[12];
- Array* key;
- Array* ivec;
+ IPints_IPint* i;
};
void IPint_bytestoip(void*);
typedef struct F_IPint_bytestoip F_IPint_bytestoip;
struct F_IPint_bytestoip
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
Array* buf;
};
-void Keyring_certtoattr(void*);
-typedef struct F_Keyring_certtoattr F_Keyring_certtoattr;
-struct F_Keyring_certtoattr
-{
- WORD regs[NREG-1];
- String** ret;
- uchar temps[12];
- Keyring_Certificate* c;
-};
-void Keyring_certtostr(void*);
-typedef struct F_Keyring_certtostr F_Keyring_certtostr;
-struct F_Keyring_certtostr
-{
- WORD regs[NREG-1];
- String** ret;
- uchar temps[12];
- Keyring_Certificate* c;
-};
void IPint_cmp(void*);
typedef struct F_IPint_cmp F_IPint_cmp;
struct F_IPint_cmp
@@ -3275,99 +3177,27 @@
WORD regs[NREG-1];
WORD* ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_copy(void*);
typedef struct F_IPint_copy F_IPint_copy;
struct F_IPint_copy
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i;
-};
-void DigestState_copy(void*);
-typedef struct F_DigestState_copy F_DigestState_copy;
-struct F_DigestState_copy
-{
- WORD regs[NREG-1];
- Keyring_DigestState** ret;
- uchar temps[12];
- Keyring_DigestState* d;
-};
-void RSAsk_decrypt(void*);
-typedef struct F_RSAsk_decrypt F_RSAsk_decrypt;
-struct F_RSAsk_decrypt
-{
- WORD regs[NREG-1];
- Keyring_IPint** ret;
- uchar temps[12];
- Keyring_RSAsk* k;
- Keyring_IPint* m;
-};
-void Keyring_descbc(void*);
-typedef struct F_Keyring_descbc F_Keyring_descbc;
-struct F_Keyring_descbc
-{
- WORD regs[NREG-1];
- WORD noret;
- uchar temps[12];
- Keyring_DESstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_desecb(void*);
-typedef struct F_Keyring_desecb F_Keyring_desecb;
-struct F_Keyring_desecb
-{
- WORD regs[NREG-1];
- WORD noret;
- uchar temps[12];
- Keyring_DESstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_dessetup(void*);
-typedef struct F_Keyring_dessetup F_Keyring_dessetup;
-struct F_Keyring_dessetup
-{
- WORD regs[NREG-1];
- Keyring_DESstate** ret;
- uchar temps[12];
- Array* key;
- Array* ivec;
-};
-void Keyring_dhparams(void*);
-typedef struct F_Keyring_dhparams F_Keyring_dhparams;
-struct F_Keyring_dhparams
-{
- WORD regs[NREG-1];
- struct{ Keyring_IPint* t0; Keyring_IPint* t1; }* ret;
- uchar temps[12];
- WORD nbits;
+ IPints_IPint* i;
};
void IPint_div(void*);
typedef struct F_IPint_div F_IPint_div;
struct F_IPint_div
{
WORD regs[NREG-1];
- struct{ Keyring_IPint* t0; Keyring_IPint* t1; }* ret;
+ struct{ IPints_IPint* t0; IPints_IPint* t1; }* ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
-};
-void RSApk_encrypt(void*);
-typedef struct F_RSApk_encrypt F_RSApk_encrypt;
-struct F_RSApk_encrypt
-{
- WORD regs[NREG-1];
- Keyring_IPint** ret;
- uchar temps[12];
- Keyring_RSApk* k;
- Keyring_IPint* m;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_eq(void*);
typedef struct F_IPint_eq F_IPint_eq;
@@ -3376,177 +3206,56 @@
WORD regs[NREG-1];
WORD* ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_expmod(void*);
typedef struct F_IPint_expmod F_IPint_expmod;
struct F_IPint_expmod
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* base;
- Keyring_IPint* exp;
- Keyring_IPint* mod;
+ IPints_IPint* base;
+ IPints_IPint* exp;
+ IPints_IPint* mod;
};
-void RSAsk_fill(void*);
-typedef struct F_RSAsk_fill F_RSAsk_fill;
-struct F_RSAsk_fill
+void IPints_genprime(void*);
+typedef struct F_IPints_genprime F_IPints_genprime;
+struct F_IPints_genprime
{
WORD regs[NREG-1];
- Keyring_RSAsk** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* n;
- Keyring_IPint* e;
- Keyring_IPint* d;
- Keyring_IPint* p;
- Keyring_IPint* q;
+ WORD nbits;
+ WORD nrep;
};
-void RSAsk_gen(void*);
-typedef struct F_RSAsk_gen F_RSAsk_gen;
-struct F_RSAsk_gen
+void IPints_gensafeprime(void*);
+typedef struct F_IPints_gensafeprime F_IPints_gensafeprime;
+struct F_IPints_gensafeprime
{
WORD regs[NREG-1];
- Keyring_RSAsk** ret;
+ struct{ IPints_IPint* t0; IPints_IPint* t1; }* ret;
uchar temps[12];
- WORD nlen;
- WORD elen;
+ WORD nbits;
WORD nrep;
};
-void DSAsk_gen(void*);
-typedef struct F_DSAsk_gen F_DSAsk_gen;
-struct F_DSAsk_gen
+void IPints_genstrongprime(void*);
+typedef struct F_IPints_genstrongprime F_IPints_genstrongprime;
+struct F_IPints_genstrongprime
{
WORD regs[NREG-1];
- Keyring_DSAsk** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_DSApk* oldpk;
-};
-void EGsk_gen(void*);
-typedef struct F_EGsk_gen F_EGsk_gen;
-struct F_EGsk_gen
-{
- WORD regs[NREG-1];
- Keyring_EGsk** ret;
- uchar temps[12];
- WORD nlen;
+ WORD nbits;
WORD nrep;
};
-void Keyring_genSK(void*);
-typedef struct F_Keyring_genSK F_Keyring_genSK;
-struct F_Keyring_genSK
-{
- WORD regs[NREG-1];
- Keyring_SK** ret;
- uchar temps[12];
- String* algname;
- String* owner;
- WORD length;
-};
-void Keyring_genSKfromPK(void*);
-typedef struct F_Keyring_genSKfromPK F_Keyring_genSKfromPK;
-struct F_Keyring_genSKfromPK
-{
- WORD regs[NREG-1];
- Keyring_SK** ret;
- uchar temps[12];
- Keyring_PK* pk;
- String* owner;
-};
-void Keyring_getbytearray(void*);
-typedef struct F_Keyring_getbytearray F_Keyring_getbytearray;
-struct F_Keyring_getbytearray
-{
- WORD regs[NREG-1];
- struct{ Array* t0; String* t1; }* ret;
- uchar temps[12];
- Sys_FD* fd;
-};
-void Keyring_getmsg(void*);
-typedef struct F_Keyring_getmsg F_Keyring_getmsg;
-struct F_Keyring_getmsg
-{
- WORD regs[NREG-1];
- Array** ret;
- uchar temps[12];
- Sys_FD* fd;
-};
-void Keyring_getstring(void*);
-typedef struct F_Keyring_getstring F_Keyring_getstring;
-struct F_Keyring_getstring
-{
- WORD regs[NREG-1];
- struct{ String* t0; String* t1; }* ret;
- uchar temps[12];
- Sys_FD* fd;
-};
-void Keyring_hmac_md5(void*);
-typedef struct F_Keyring_hmac_md5 F_Keyring_hmac_md5;
-struct F_Keyring_hmac_md5
-{
- WORD regs[NREG-1];
- Keyring_DigestState** ret;
- uchar temps[12];
- Array* data;
- WORD n;
- Array* key;
- Array* digest;
- Keyring_DigestState* state;
-};
-void Keyring_hmac_sha1(void*);
-typedef struct F_Keyring_hmac_sha1 F_Keyring_hmac_sha1;
-struct F_Keyring_hmac_sha1
-{
- WORD regs[NREG-1];
- Keyring_DigestState** ret;
- uchar temps[12];
- Array* data;
- WORD n;
- Array* key;
- Array* digest;
- Keyring_DigestState* state;
-};
-void Keyring_ideacbc(void*);
-typedef struct F_Keyring_ideacbc F_Keyring_ideacbc;
-struct F_Keyring_ideacbc
-{
- WORD regs[NREG-1];
- WORD noret;
- uchar temps[12];
- Keyring_IDEAstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_ideaecb(void*);
-typedef struct F_Keyring_ideaecb F_Keyring_ideaecb;
-struct F_Keyring_ideaecb
-{
- WORD regs[NREG-1];
- WORD noret;
- uchar temps[12];
- Keyring_IDEAstate* state;
- Array* buf;
- WORD n;
- WORD direction;
-};
-void Keyring_ideasetup(void*);
-typedef struct F_Keyring_ideasetup F_Keyring_ideasetup;
-struct F_Keyring_ideasetup
-{
- WORD regs[NREG-1];
- Keyring_IDEAstate** ret;
- uchar temps[12];
- Array* key;
- Array* ivec;
-};
void IPint_inttoip(void*);
typedef struct F_IPint_inttoip F_IPint_inttoip;
struct F_IPint_inttoip
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
WORD i;
};
@@ -3555,10 +3264,10 @@
struct F_IPint_invert
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* base;
- Keyring_IPint* mod;
+ IPints_IPint* base;
+ IPints_IPint* mod;
};
void IPint_iptob64(void*);
typedef struct F_IPint_iptob64 F_IPint_iptob64;
@@ -3567,7 +3276,7 @@
WORD regs[NREG-1];
String** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_iptob64z(void*);
typedef struct F_IPint_iptob64z F_IPint_iptob64z;
@@ -3576,7 +3285,7 @@
WORD regs[NREG-1];
String** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_iptobebytes(void*);
typedef struct F_IPint_iptobebytes F_IPint_iptobebytes;
@@ -3585,7 +3294,7 @@
WORD regs[NREG-1];
Array** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_iptobytes(void*);
typedef struct F_IPint_iptobytes F_IPint_iptobytes;
@@ -3594,7 +3303,7 @@
WORD regs[NREG-1];
Array** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_iptoint(void*);
typedef struct F_IPint_iptoint F_IPint_iptoint;
@@ -3603,7 +3312,7 @@
WORD regs[NREG-1];
WORD* ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_iptostr(void*);
typedef struct F_IPint_iptostr F_IPint_iptostr;
@@ -3612,506 +3321,533 @@
WORD regs[NREG-1];
String** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
WORD base;
};
-void Keyring_md4(void*);
-typedef struct F_Keyring_md4 F_Keyring_md4;
-struct F_Keyring_md4
-{
- WORD regs[NREG-1];
- Keyring_DigestState** ret;
- uchar temps[12];
- Array* buf;
- WORD n;
- Array* digest;
- Keyring_DigestState* state;
-};
-void Keyring_md5(void*);
-typedef struct F_Keyring_md5 F_Keyring_md5;
-struct F_Keyring_md5
-{
- WORD regs[NREG-1];
- Keyring_DigestState** ret;
- uchar temps[12];
- Array* buf;
- WORD n;
- Array* digest;
- Keyring_DigestState* state;
-};
void IPint_mod(void*);
typedef struct F_IPint_mod F_IPint_mod;
struct F_IPint_mod
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_mul(void*);
typedef struct F_IPint_mul F_IPint_mul;
struct F_IPint_mul
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
void IPint_neg(void*);
typedef struct F_IPint_neg F_IPint_neg;
struct F_IPint_neg
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i;
+ IPints_IPint* i;
};
void IPint_not(void*);
typedef struct F_IPint_not F_IPint_not;
struct F_IPint_not
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i1;
+ IPints_IPint* i1;
};
void IPint_ori(void*);
typedef struct F_IPint_ori F_IPint_ori;
struct F_IPint_ori
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_IPint* i1;
- Keyring_IPint* i2;
+ IPints_IPint* i1;
+ IPints_IPint* i2;
};
-void Keyring_pktoattr(void*);
-typedef struct F_Keyring_pktoattr F_Keyring_pktoattr;
-struct F_Keyring_pktoattr
+void IPints_probably_prime(void*);
+typedef struct F_IPints_probably_prime F_IPints_probably_prime;
+struct F_IPints_probably_prime
{
WORD regs[NREG-1];
- String** ret;
+ WORD* ret;
uchar temps[12];
- Keyring_PK* pk;
+ IPints_IPint* n;
+ WORD nrep;
};
-void Keyring_pktostr(void*);
-typedef struct F_Keyring_pktostr F_Keyring_pktostr;
-struct F_Keyring_pktostr
+void IPint_random(void*);
+typedef struct F_IPint_random F_IPint_random;
+struct F_IPint_random
{
WORD regs[NREG-1];
- String** ret;
+ IPints_IPint** ret;
uchar temps[12];
- Keyring_PK* pk;
+ WORD nbits;
};
-void Keyring_putbytearray(void*);
-typedef struct F_Keyring_putbytearray F_Keyring_putbytearray;
-struct F_Keyring_putbytearray
+void IPint_shl(void*);
+typedef struct F_IPint_shl F_IPint_shl;
+struct F_IPint_shl
{
WORD regs[NREG-1];
- WORD* ret;
+ IPints_IPint** ret;
uchar temps[12];
- Sys_FD* fd;
- Array* a;
+ IPints_IPint* i;
WORD n;
};
-void Keyring_puterror(void*);
-typedef struct F_Keyring_puterror F_Keyring_puterror;
-struct F_Keyring_puterror
+void IPint_shr(void*);
+typedef struct F_IPint_shr F_IPint_shr;
+struct F_IPint_shr
{
WORD regs[NREG-1];
- WORD* ret;
+ IPints_IPint** ret;
uchar temps[12];
- Sys_FD* fd;
- String* s;
+ IPints_IPint* i;
+ WORD n;
};
-void Keyring_putstring(void*);
-typedef struct F_Keyring_putstring F_Keyring_putstring;
-struct F_Keyring_putstring
+void IPint_strtoip(void*);
+typedef struct F_IPint_strtoip F_IPint_strtoip;
+struct F_IPint_strtoip
{
WORD regs[NREG-1];
- WORD* ret;
+ IPints_IPint** ret;
uchar temps[12];
- Sys_FD* fd;
- String* s;
+ String* str;
+ WORD base;
};
-void IPint_random(void*);
-typedef struct F_IPint_random F_IPint_random;
-struct F_IPint_random
+void IPint_sub(void*);
+typedef struct F_IPint_sub F_IPint_sub;
+struct F_IPint_sub
{
WORD regs[NREG-1];
- Keyring_IPint** ret;
+ IPints_IPint** ret;
***The diff for this file has been truncated for email.***
==============================================================================
Revision: 9cb180d907
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 17:43:26 2010
Log: Propagate CCACHE flag along channels in devmnt.
http://code.google.com/p/inferno-npe/source/detail?r=9cb180d907
Modified:
/emu/port/cache.c
/emu/port/devmnt.c
=======================================
--- /emu/port/cache.c Fri Dec 22 09:07:39 2006
+++ /emu/port/cache.c Tue Oct 26 17:43:26 2010
@@ -2,7 +2,7 @@
#include "fns.h"
/*
- * no cache in hosted mode
+ * 9P file cache
*/
void
cinit(void)
@@ -12,7 +12,7 @@
void
copen(Chan *c)
{
- c->flag &= ~CCACHE;
+ USED(c);
}
int
=======================================
--- /emu/port/devmnt.c Tue Sep 29 19:04:09 2009
+++ /emu/port/devmnt.c Tue Oct 26 17:43:26 2010
@@ -451,6 +451,10 @@
for(i=0; i<wq->nqid; i++)
wq->qid[i] = r->reply.wqid[i];
+ /* propagate CCACHE flag */
+ if(c->flag & CCACHE)
+ nc->flag |= CCACHE;
+
Return:
poperror();
mntfree(r);
==============================================================================
Revision: 09a2e71961
Author: Venkatesh Srinivas <
m...@endeavour.zapto.org>
Date: Tue Oct 26 18:40:11 2010
Log: Implement deferred clunk for cached devmnt mounts; clunks are carried
out by
an asynchronous closeproc.
http://code.google.com/p/inferno-npe/source/detail?r=09a2e71961
Modified:
/emu/port/chan.c
/emu/port/dat.h
/emu/port/devmnt.c
/emu/port/fns.h
/emu/port/master
/mkconfig
=======================================
--- /emu/port/chan.c Tue Oct 26 17:37:48 2010
+++ /emu/port/chan.c Tue Oct 26 18:40:11 2010
@@ -4,7 +4,6 @@
static int n_chans = 0;
static int n_active_chans = 0;
-static int stats_init = 0;
char*
c2name(Chan *c) /* DEBUGGING */
@@ -135,12 +134,6 @@
{
Chan *c;
- if (stats_init == 0) {
- stats_init = 1;
- vmstat_entry("vm.n_chans", &n_chans, &chanalloc.l);
- vmstat_entry("vm.n_active_chans", &n_active_chans, &chanalloc.l);
- }
-
lock(&chanalloc.l);
c = chanalloc.free;
if(c != 0) {
@@ -179,6 +172,9 @@
c->mqid.vers = 0;
c->mqid.type = 0;
c->name = 0;
+ c->deferclose = 0;
+ c->dclosem = nil;
+ c->dcloser = nil;
return c;
}
@@ -296,7 +292,73 @@
poperror();
}
- chanfree(c);
+ if (!c->deferclose)
+ chanfree(c);
+}
+
+struct {
+ Chan *head;
+ Chan *tail;
+ int nqueued;
+ int peak_nqueued;
+ Lock l;
+ Rendez r;
+} clunkq;
+void closeproc(void *);
+
+void
+cdeferclose(Mnt *m, Mntrpc *r, Chan *c)
+{
+ lock(&clunkq.l);
+ clunkq.nqueued++;
+ if (clunkq.nqueued > clunkq.peak_nqueued)
+ clunkq.peak_nqueued = clunkq.nqueued;
+ c->next = nil;
+ if(clunkq.head)
+ clunkq.tail->next = c;
+ else
+ clunkq.head = c;
+ clunkq.tail = c;
+ unlock(&clunkq.l);
+
+ Wakeup(&clunkq.r);
+}
+
+int
+checkclunkq(void *arg)
+{
+ int cnt;
+
+ lock(&clunkq.l);
+ cnt = clunkq.nqueued;
+ unlock(&clunkq.l);
+
+ return (cnt > 0) ? 1 : 0;
+}
+
+void
+closeproc(void *arg)
+{
+ Chan *c;
+
+ for (;;) {
+ Sleep(&clunkq.r, checkclunkq, arg);
+ lock(&clunkq.l);
+
+ if (clunkq.head == nil) {
+ unlock(&clunkq.l);
+ continue;
+ }
+ c = clunkq.head;
+ clunkq.head = c->next;
+ clunkq.nqueued--;
+ unlock(&clunkq.l);
+
+ /* From devmnt */
+ mountrpc(c->dclosem, c->dcloser);
+ mntfree(c->dcloser);
+ chanfree(c);
+ }
}
/*
@@ -1389,3 +1451,15 @@
free(m);
}
}
+
+void
+chaninit(void)
+{
+ vmstat_entry("vm.n_chans", &n_chans, &chanalloc.l);
+ vmstat_entry("vm.n_active_chans", &n_active_chans, &chanalloc.l);
+ vmstat_entry("vm.clunkq_nqueued", &clunkq.nqueued, &clunkq.l);
+ vmstat_entry("vm.clunkq_peak_nqueued", &clunkq.peak_nqueued, &clunkq.l);
+
+ kproc("closeproc", closeproc, nil, 0);
+}
+
=======================================
--- /emu/port/dat.h Tue Oct 26 17:37:48 2010
+++ /emu/port/dat.h Tue Oct 26 18:40:11 2010
@@ -127,7 +127,11 @@
int uri; /* union read index */
int dri; /* devdirread index */
ulong mountid;
- Mnt *mux; /* Mnt for clients using me for messages */
+ int deferclose; /* deferred close via devtab->close() */
+ Mnt *dclosem;
+ Mntrpc *dcloser;
+
+ Mnt *mux; /* Mnt for clients using me for messages */
void* aux; /* device specific data */
Chan* mchan; /* channel to mounted server */
Qid mqid; /* qid of root of mount point */
=======================================
--- /emu/port/devmnt.c Tue Oct 26 17:43:26 2010
+++ /emu/port/devmnt.c Tue Oct 26 18:40:11 2010
@@ -86,6 +86,7 @@
/* fmtinstall('D', dirfmt); */
/* fmtinstall('M', dirmodefmt); */
+ chaninit();
cinit();
}
@@ -545,7 +546,7 @@
}
static void
-mntclunk(Chan *c, int t)
+mntclunk(Chan *c, int t, int deferable)
{
Mnt *m;
Mntrpc *r;
@@ -559,8 +560,16 @@
r->request.type = t;
r->request.fid = c->fid;
- mountrpc(m, r);
- mntfree(r);
+ if ((c->flag & CCACHE) && !(c->flag & ORCLOSE) && deferable) {
+ c->deferclose = 1;
+ c->dclosem = m;
+ c->dcloser = r;
+ cdeferclose(m, r, c);
+ } else {
+ c->deferclose = 0;
+ mountrpc(m, r);
+ mntfree(r);
+ }
poperror();
}
@@ -605,13 +614,13 @@
static void
mntclose(Chan *c)
{
- mntclunk(c, Tclunk);
+ mntclunk(c, Tclunk, 1);
}
static void
mntremove(Chan *c)
{
- mntclunk(c, Tremove);
+ mntclunk(c, Tremove, 0);
}
static int
=======================================
--- /emu/port/fns.h Mon May 10 15:52:41 2010
+++ /emu/port/fns.h Tue Oct 26 18:40:11 2010
@@ -17,6 +17,7 @@
void chandevinit(void);
void chanfree(Chan*);
Dir* chandirstat(Chan*);
+void chaninit(void);
void cinit(void);
char* clipread(void);
int clipwrite(char*);
=======================================
--- /emu/port/master Sat Oct 25 02:42:11 2008
+++ /emu/port/master Tue Oct 26 18:40:11 2010
@@ -1,28 +1,5 @@
# do not edit; automatically generated
-% mem
-* indir
-/ root
-A audio
-C cmd
-D ssl
-F tinyfs
-I ip
-M mnt
-P prof
-U fs
-^ snarf
-a arch
-c cons
-d dup
-e env
-i draw
-m pointer
-p prog
-s srv
-| pipe
-τ tk
-₪ srv9
α local use
β local use
=======================================
--- /mkconfig Fri Jan 22 06:47:30 2010
+++ /mkconfig Tue Oct 26 18:40:11 2010
@@ -5,7 +5,7 @@
# On Nt systems, the ROOT path MUST be of the form `drive:/path'
#ROOT=/usr/inferno
-ROOT=$HOME/inferno-npe
+ROOT=$HOME/Desktop/inferno-npe
#
# Specify the flavour of Tk (std for standard builds)
@@ -16,7 +16,7 @@
# Except for building kernels, SYSTARG must always be the same as SYSHOST
#
#SYSHOST=Plan9 # build system OS type (Inferno, Irix, Linux, MacOSX, Nt,
Plan9, Solaris)
-SYSHOST=Linux
+SYSHOST=MacOSX
SYSTARG=$SYSHOST # target system OS type (Inferno, Irix, Linux, MacOSX,
Nt, Plan9, Solaris)
#
@@ -25,7 +25,7 @@
#
#OBJTYPE=386 # target system object type (eg, 386, arm, mips, power,
s800, sparc)
#OBJTYPE=$objtype
-OBJTYPE=386
+OBJTYPE=power
#
# no changes required beyond this point