From e5126b09222138c70d295478f8de10033ba933d3 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 11 Oct 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-10-11 --- port/cache.c | 31 +++++++++++++++++++++++++++++++ port/devmnt.c | 10 ++++------ port/swap.c | 8 +++++--- 3 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 port/cache.c diff --git a/port/cache.c b/port/cache.c new file mode 100644 index 0000000000000000000000000000000000000000..ab667d9f98a85bd79021b535c800a920161f22bc --- /dev/null +++ b/port/cache.c @@ -0,0 +1,31 @@ +#include "u.h" +#include "../port/lib.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "../port/error.h" +#include "devtab.h" + +typedef struct Fcache Fcache; +typedef struct Fcalloc Fcalloc; +struct Fcache +{ + QLock; + Qid; + Page* alloc; + Fcache* hash; + Fcache* next; +}; + +struct Fcalloc +{ + ulong start; + short len; + Page* data; +}; + +Fcache* +clook(Qid *qid) +{ + +} diff --git a/port/devmnt.c b/port/devmnt.c index eedc73fca4c09a681e2762b0c7bd831c9db7f55c..92d69976dd24fd399b4b8a91a1c88719fe3cb416 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -56,11 +56,9 @@ Chan* mntchan(void); enum { - Tagspace = 1, - Tagfls = 0x8000, - Tagend = 0xfffe, - - ALIGN = 256, /* Vme block mode alignment */ + Tagspace = 1, + Tagfls = 0x8000, + Tagend = 0xfffe, }; void @@ -862,7 +860,7 @@ mntchk(Chan *c) error(Eshutdown); /* - * Try and get the channel back + * Try and get the channel back after a crash */ if((c->flag&CRECOV) && m->recprog == 0) recoverchan(m, c); diff --git a/port/swap.c b/port/swap.c index 4a1a970399a6aa623cabeeaf294034139e4c56cd..8e6cf6fb6d24ef22ffe2117bf295f4482983251f 100644 --- a/port/swap.c +++ b/port/swap.c @@ -94,9 +94,10 @@ kickpager(void) void pager(void *junk) { - Proc *p, *ep; - Segment *s; int i; + Image *img; + Segment *s; + Proc *p, *ep; if(waserror()) panic("pager: os error\n"); @@ -115,7 +116,8 @@ loop: p = proctab(0); /* don't swap out programs from devroot.c */ - if(devchar[p->seg[SG_TEXT]->image->c->type] == '/') + img = p->seg[SG_TEXT]->image; + if(img && devchar[img->c->type] == '/') continue; if(p->state == Dead || p->kp)