From 84fc9dc11138b716afeaaad735e403df5c0cafcc Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 16 Jan 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-01-16 --- pc/mmu.c | 2 +- ss/bbmalloc.c | 27 +++++---------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/pc/mmu.c b/pc/mmu.c index a1b2fc047a7945dce050bcbc4b4503bb877073f6..8ae0718f1804b8648efd9d7c9f7f181bb75590dc 100644 --- a/pc/mmu.c +++ b/pc/mmu.c @@ -53,7 +53,7 @@ Tss tss; #define D16SEGM(p) { 0xFFFF, (0x0<<16)|SEGP|SEGPL(p)|SEGDATA|SEGW } #define E16SEGM(p) { 0xFFFF, (0x0<<16)|SEGP|SEGPL(p)|SEGEXEC|SEGR } #define TSSSEGM(b,p) { ((b)<<16)|sizeof(Tss),\ - ((b)&0xFF000000)|(((b)<<16)&0xFF)|SEGTSS|SEGPL(p)|SEGP } + ((b)&0xFF000000)|(((b)>>16)&0xFF)|SEGTSS|SEGPL(p)|SEGP } /* * global descriptor table describing all segments diff --git a/ss/bbmalloc.c b/ss/bbmalloc.c index c9eed4fe01c8a16304020c82e9e7112e57d5f632..e99f9ae822c1ee42ce5cf919ea13250f9c746dea 100644 --- a/ss/bbmalloc.c +++ b/ss/bbmalloc.c @@ -7,21 +7,6 @@ /* * Allocate memory for use in kernel bitblts. - * The allocated memory must have a flushed instruction - * cache, and the data cache must be flushed by bbdflush(). - * To avoid the need for frequent cache flushes, the memory - * is allocated out of an arena, and the i-cache is only - * flushed when it has to be reused. By returning an - * address in non-cached space, the need for flushing the - * d-cache is avoided. - * - * Currently, the only kernel users of bitblt are devbit, - * print, and the cursor stuff in devbit. The cursor - * can get drawn at clock interrupt time, so it might need - * to bbmalloc while another bitblt is going on. - * - * This code will have to be interlocked if we ever get - * a multiprocessor with a bitmapped display. */ /* a 0->3 bitblt can take 900 words */ @@ -48,10 +33,6 @@ bbmalloc(int nbytes) ans = bbcur; bbcur = ans + nw; splx(s); -/* - if(ans == bbarena) - icflush(ans, sizeof(bbarena)); -*/ bblast = ans; ans = (void *)ans; return ans; @@ -66,8 +47,10 @@ bbfree(void *p, int n) bbcur = (ulong *)(((char *)bblast) + n); } -void * -bbdflush(void *p, int n) +int +bbonstack(void) { - return p; + if(u) + return 1; + return 0; }