From e43ce1cea26b1b8b323ad460c22ac3fb482272a1 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 1 May 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-05-01 --- bitsy/devuda1341.c | 3 ++- bitsy/main.c | 2 +- bitsy/sa1110dma.c | 2 +- pc/devvga.c | 26 +++++++++++++++++++------- pc/screen.h | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/bitsy/devuda1341.c b/bitsy/devuda1341.c index 717a8a090176f31c9b5b78f55fc3ff1add4d1389..60359bc4d038c85e110141fe574f0c4229b30f78 100644 --- a/bitsy/devuda1341.c +++ b/bitsy/devuda1341.c @@ -19,7 +19,7 @@ #include "io.h" #include "sa1110dma.h" -static int debug = 0; +static int debug = 2; /* * GPIO based L3 bus support. @@ -442,6 +442,7 @@ audioinit(void) mcpregs->status &= ~(1<<16); sspregs = mapspecial(SSPREGS, 32); + } uchar status0[1] = {0x22}; diff --git a/bitsy/main.c b/bitsy/main.c index 110e72b1ef4dba245bbf54fa7cad6186aedc747c..eec0c6ac14d53ecb3f267210b2b36179f840155c 100644 --- a/bitsy/main.c +++ b/bitsy/main.c @@ -381,7 +381,7 @@ machinit(void) gpioregs->altfunc |= GPIO_LDD8_o|GPIO_LDD9_o|GPIO_LDD10_o|GPIO_LDD11_o |GPIO_LDD12_o|GPIO_LDD13_o|GPIO_LDD14_o|GPIO_LDD15_o - |GPIO_SSP_CLK_i; + |GPIO_SSP_CLK_i|GPIO_SSP_RXD_i; /* map in special H3650 io pins */ egpioreg = mapspecial(EGPIOREGS, 4); diff --git a/bitsy/sa1110dma.c b/bitsy/sa1110dma.c index 1a5352f8beb27062e0e694a7cfdcbc4efe79fd1d..f1f74a2a427b2f42df14a07cc476cd46081ec86a 100644 --- a/bitsy/sa1110dma.c +++ b/bitsy/sa1110dma.c @@ -7,7 +7,7 @@ #include "../port/error.h" #include "sa1110dma.h" -static int debug = 0; +static int debug = 2; /* * DMA helper routines diff --git a/pc/devvga.c b/pc/devvga.c index d0f62bafe4a279c03041ad3cfda008213d4ff939..457f4576b4b82b7b5983bb91868196375be87ddd 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -61,19 +61,31 @@ vgastat(Chan* c, char* dp) static Chan* vgaopen(Chan* c, int omode) { + VGAscr *scr; + static char *openctl = "openctl\n"; + + scr = &vgascreen[0]; + if ((c->qid.path & ~CHDIR) == Qvgaovlctl) { + if (scr->dev->ovlctl) + scr->dev->ovlctl(scr, c, openctl, strlen(openctl)); + else + error(Enonexist); + } return devopen(c, omode, vgadir, nelem(vgadir), devgen); } static void -vgaclose(Chan*) +vgaclose(Chan* c) { VGAscr *scr; + static char *closectl = "closectl\n"; scr = &vgascreen[0]; - if (scr && scr->dev && scr->dev->ovlctl) { - static char disable[] = "disable\n"; - - scr->dev->ovlctl(scr, disable, strlen(disable)); + if ((c->qid.path & ~CHDIR) == Qvgaovlctl) { + if (scr->dev->ovlctl) + scr->dev->ovlctl(scr, c, closectl, strlen(closectl)); + else + error(Enonexist); } } @@ -397,8 +409,8 @@ vgawrite(Chan* c, void* a, long n, vlong off) error(Enooverlay); break; } - pprint("vgawrite: Calling ovlctl (%p) (%s)\n", scr->dev->ovlctl, a); - return scr->dev->ovlctl(scr, a, n); + scr->dev->ovlctl(scr, c, a, n); + return n; default: error(Egreg); diff --git a/pc/screen.h b/pc/screen.h index 5aea5675b16a6ba7e1db93469bae25912c717686..cf6f71ced3478c8eaf6f69048e89cbd4a002b2cf 100644 --- a/pc/screen.h +++ b/pc/screen.h @@ -68,7 +68,7 @@ struct VGAdev { ulong (*linear)(VGAscr*, int*, int*); void (*drawinit)(VGAscr*); int (*fill)(VGAscr*, Rectangle, ulong); - int (*ovlctl)(VGAscr*, void*, int); + void (*ovlctl)(VGAscr*, Chan*, void*, int); int (*ovlwrite)(VGAscr*, void*, int, vlong); };