From 6afafac33166edd6d29025634f81987a5af6c24a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 9 Feb 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-02-09 --- port/portdat.h | 1 - port/sysfile.c | 7 +++++++ port/systab.h | 3 +++ power/mmu.c | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/port/portdat.h b/port/portdat.h index e213594213e000e24965a2b69b83df55a6b3fa2a..750f382e499e010f6cfcfc5657657c3d81042311 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -344,7 +344,6 @@ struct Page ulong va; /* Virtual address for user */ ulong daddr; /* Disc address on swap */ ushort ref; /* Reference count */ - char lock; /* Software lock */ char modref; /* Simulated modify/reference bits */ char cachectl[MAXMACH]; /* Cache flushing control for putmmu */ Image *image; /* Associated text or swap image */ diff --git a/port/sysfile.c b/port/sysfile.c index fecd25f68e178fb41a8bb0a0bf0e8fccd8aee641..2d9232ffea533bb385c36e77f5a9994d4072011f 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -84,6 +84,13 @@ openmode(ulong o) return o; } +long +sysfsession(ulong *arg) +{ + USED(arg); + return 0; +} + long syspipe(ulong *arg) { diff --git a/port/systab.h b/port/systab.h index 0c89c102c0f9806f2b8593aa0bfe3a37e578e2e6..aa617daa669e3b0c40f14f08036f7b1459872586 100644 --- a/port/systab.h +++ b/port/systab.h @@ -40,6 +40,7 @@ Syscall syssegflush; Syscall sysrendezvous; Syscall sysunmount; Syscall syswait; +Syscall sysfsession; Syscall sysdeath; Syscall *systab[]={ @@ -80,6 +81,7 @@ Syscall *systab[]={ [RENDEZVOUS] sysrendezvous, [UNMOUNT] sysunmount, [WAIT] syswait, + [FSESSION] sysfsession, }; char *sysctab[]={ @@ -120,4 +122,5 @@ char *sysctab[]={ [RENDEZVOUS] "Rendez", [UNMOUNT] "Unmount", [WAIT] "Wait", + [FSESSION] "Fsession", }; diff --git a/power/mmu.c b/power/mmu.c index 39635632545fdd4d852f7cb51ec6885982764d43..202124eddc42f8969fe21c364961caee17e77862 100644 --- a/power/mmu.c +++ b/power/mmu.c @@ -180,3 +180,43 @@ putstlb(ulong tlbvirt, ulong tlbphys) if(tlbphys == 0) entry->virt = 0; } + +/* Mapping routines for td's frame buffer +Page* +a16seg(Segment *s, ulong va) +{ + Page *pg; + + pg = smalloc(sizeof(Page)); + memset(pg, 0, sizeof(Page)); + pg->va = va; + pg->pa = 0xd0000 + (va - s->base); + pg->ref = 1; + return pg; +} + +Page* +a32seg(Segment *s, ulong va) +{ + Page *pg; + + pg = smalloc(sizeof(Page)); + memset(pg, 0, sizeof(Page)); + pg->va = va; + pg->pa = VMEA32SUP(ulong, va - s->base); + pg->ref = 1; + return pg; +} + +void +vmefree(Page *pg) +{ + int x; + + lock(pg); + x = --pg->ref; + unlock(pg); + if(x <= 0) + free(pg); +} +*/