--- /lib/face/48x48x8/.dict Mon May 21 19:45:43 2012 +++ /lib/face/48x48x8/.dict Sat Aug 3 00:54:51 2013 @@ -40,6 +40,7 @@ cl/unknown u/unknown.cl cmu.edu/pstanley p/pstanley.1 cn/unknown u/unknown.cn +co/unknown u/unknown.co comcast.net/unknown c/comcast.1 coraid.com/mennis m/mennis.1 coraid.com/quanstro q/quanstro.1 @@ -50,6 +51,7 @@ cz/unknown u/unknown.cz de/unknown u/unknown.de dk/unknown u/unknown.dk +do/unknown u/unknown.do ee/unknown u/unknown.ee ens.fr/unknown e/ens.1 es/unknown u/unknown.es @@ -93,6 +95,7 @@ ie/unknown u/unknown.ie il/unknown u/unknown.il in/unknown u/unknown.in +info/unknown u/unknown.info inria.fr/unknown i/inria.1 insultant.net/boyd b/boyd.1 inter.net/boyd b/boyd.1 --- /sys/man/1/patch Fri Feb 5 18:32:02 2010 +++ /sys/man/1/patch Sat Aug 3 00:18:29 2013 @@ -44,10 +44,11 @@ .PP .I Patch/create creates a new patch consisting of the changes to -the listed files from the distribution, reading +the listed text files from the distribution, reading a description of the patch from standard input: please provide an explanation of what the change is supposed to do, some context, and a rationale for the change. +Please do not submit binary files. Test data or pointers to same to verify that the fix works are also welcome. When sending a patch, follow these guidelines: .IP • 3 --- /sys/man/2/graphics Mon Dec 15 02:26:15 2008 +++ /sys/man/2/graphics Sat Aug 3 00:01:28 2013 @@ -18,11 +18,8 @@ .PP .B int geninitdraw(char *devdir, void(*errfun)(Display*, char*), -.PP -.B - char *font, char *label, char *mousedir, char *windir, .B - int ref) + char *font, char *label, char *windir, int ref) .PP .B int newwindow(char *str) @@ -368,12 +365,8 @@ .I label are as in .IR initdraw ; -.I mousedir -and .I windir -are the directories holding the -.B mouse -and +is the directory holding the .B winname files; and .I ref --- /sys/man/2/venti-conn Mon Dec 3 00:42:21 2007 +++ /sys/man/2/venti-conn Fri Aug 2 23:03:23 2013 @@ -86,7 +86,18 @@ (see .IR dial (2)) and returns a corresponding connection. -It returns nil if the connection cannot be established. +If +.I addr +is +.BR nil , +the environment variable +.B venti +will be used if set; if not, the address +.B tcp!$venti!venti +will be used. +It returns +.B nil +if the connection cannot be established. .PP .I Vtversion exchanges version information with the remote side @@ -102,7 +113,7 @@ on the connection .IR z . The packet -.IR p +.I p should be a formatted Venti message as might be returned by .IR vtfcallpack ; --- /sys/man/4/exportfs Mon Mar 14 20:37:29 2011 +++ /sys/man/4/exportfs Sat Aug 3 00:05:49 2013 @@ -139,17 +139,27 @@ .B -r \fIroot Bypass the initial protocol, serving the name space rooted at .IR root . +A corresponding +.IR import (4) +must use the +.B -m +option. .TP .B -S \fIservice -bypass the initial protocol, serving the result of mounting +Bypass the initial protocol, serving the result of mounting .IR service . A separate mount is used for each .IR attach (5) message, to correctly handle servers in which each mount corresponds to a different client -.IR e.g. , ( +(e.g., .IR rio (4)). +A corresponding +.IR import (4) +must use the +.B -m +option. .TP .B -s equivalent to --- /sys/man/4/import Mon Dec 3 00:42:23 2007 +++ /sys/man/4/import Sat Aug 3 00:05:49 2013 @@ -13,6 +13,14 @@ ] .PP .B import +.B -m +[ +.I options +] +.I system +.I mountpoint +.PP +.B import .B -B [ .I options @@ -114,6 +122,27 @@ Post the connection's mountable file descriptor as .BI /srv/ name\fR. .PD +.PP +The +.B -m +option mounts a file exported by +.IR exportfs (4) +with its +.B -r +or +.B -S +options, which skip the part of its protocol that allows the importer to specify +the +.I file +to export. +Instead, the file or name space is selected by +.IR exportfs , +and +.I import +mounts it on +.I mountpoint +as guided by the other +.IR options . .PP The .B -B --- /sys/man/8/booting Fri Jul 19 21:51:13 2013 +++ /sys/man/8/booting Sat Aug 3 05:17:11 2013 @@ -70,7 +70,7 @@ . .SS MIPS Routerboard CPU Server Configure RouterBOOT via the serial port (115200 baud) -to always boot from Ethernet, and arrange to load the ELF executable +to always boot from Ethernet via DHCP and TFTP, and arrange to load the ELF executable .B /mips/9rb in .IR ndb (6). --- /sys/src/9/kw/trap.c Tue Mar 26 21:33:31 2013 +++ /sys/src/9/kw/trap.c Fri Aug 2 23:08:45 2013 @@ -428,6 +428,9 @@ case PsrMabt: /* prefetch fault */ ldrexvalid = 0; faultarm(ureg, ureg->pc, user, 1); + if(up->nnote == 0 && + (*(u32int*)ureg->pc & ~(0xF<<28)) == 0x01200070) + postnote(up, 1, "sys: breakpoint", NDebug); break; case PsrMabt+1: /* data fault */ ldrexvalid = 0; @@ -492,10 +495,9 @@ case PsrMund: /* undefined instruction */ if(user){ if(seg(up, ureg->pc, 0) != nil && - *(u32int*)ureg->pc == 0xD1200070){ - snprint(buf, sizeof buf, "sys: breakpoint"); - postnote(up, 1, buf, NDebug); - }else{ + (*(u32int*)ureg->pc & ~(0xF<<28)) == 0x01200070) + postnote(up, 1, "sys: breakpoint", NDebug); + else{ /* look for floating point instructions to interpret */ x = spllo(); rv = fpiarm(ureg); --- /sys/src/9/mkfile Wed Jul 24 00:28:06 2013 +++ /sys/src/9/mkfile Sat Aug 3 01:57:51 2013 @@ -7,7 +7,7 @@ ppc\ rb\ teg2\ - + all:V: for(i in $ARCH)@{ cd $i @@ -23,7 +23,7 @@ installall install:V: for(i in $ARCH) @{ cd $i - mk install + mk $target } @{ cd pc; mk clean } @{ cd pcboot; mk install } --- /sys/src/9/mtx/mtxcpu Fri Aug 31 00:49:55 2007 +++ /sys/src/9/mtx/mtxcpu Sat Aug 3 02:02:15 2013 @@ -40,7 +40,9 @@ tcp bootdir - bootmtxcpu.out boot - ipconfig.hack ipconfig - factotum.hack factotum - + boot$CONF.out boot +# don't know how to generate foo.hack, so use the stock ones +# ipconfig.hack ipconfig +# factotum.hack factotum + /power/bin/ip/ipconfig + /power/bin/auth/factotum --- /sys/src/9/pc/uartox.c Thu Jan 1 01:00:00 1970 +++ /sys/src/9/pc/uartox.c Fri Aug 2 23:23:17 2013 @@ -0,0 +1,583 @@ +/* + * Oxford Semiconductor OXPCIe95x UART driver + */ +#include "u.h" +#include "../port/lib.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "io.h" +#include "../port/error.h" + +extern PhysUart oxphysuart; + +enum { + Ccr = 0x0000/4, /* Class Code and Revision ID */ + Nuart = 0x0004/4, /* Decimal Number of UARTs */ + Gis = 0x0008/4, /* Global UART IRQ Status */ + Gie = 0x000C/4, /* Global UART IRQ Enable */ + Gid = 0x0010/4, /* Global UART IRQ Disable */ + Gwe = 0x0014/4, /* Global UART Wake Enable */ + Gwd = 0x0018/4, /* Global UART Wake Disable */ +}; + +enum { + Thr = 0x00, /* Transmitter Holding */ + Rhr = 0x00, /* Receiver Holding */ + Ier = 0x01, /* Interrupt Enable */ + Fcr = 0x02, /* FIFO Control */ + Isr = 0x02, /* Interrupt Status */ + Lcr = 0x03, /* Line Control */ + Mcr = 0x04, /* Modem Control */ + Lsr = 0x05, /* Line Status */ + Msr = 0x06, /* Modem Status */ + Spr = 0x07, /* Scratch Pad */ + Dll = 0x00, /* Divisor Latch LSB */ + Dlm = 0x01, /* Divisor Latch MSB */ + Efr = 0x02, /* Enhanced Feature */ +}; + +typedef struct Port Port; +typedef struct Ctlr Ctlr; + +struct Port { + Uart; + Ctlr *ctlr; + u8int *mem; + + int level; + int dtr, rts; + int ri; +}; + +struct Ctlr { + Lock; + char *name; + Pcidev *pcidev; + u32int *mem; + + u32int im; + + Port port[0x10]; + int nport; +}; + +static Uart * +oxpnp(void) +{ + Pcidev *p; + Ctlr *ctlr; + Port *port; + int i; + char *model; + char name[12+1]; + Uart *head, *tail; + static int ctlrno; + + p = nil; + head = tail = nil; + while(p = pcimatch(p, 0x1415, 0)){ + switch(p->did){ + case 0xc101: + case 0xc105: + case 0xc11b: + case 0xc11f: + case 0xc120: + case 0xc124: + case 0xc138: + case 0xc13d: + case 0xc140: + case 0xc141: + case 0xc144: + case 0xc145: + case 0xc158: + case 0xc15d: + model = "OXPCIe952"; + break; + case 0xc208: + case 0xc20d: + model = "OXPCIe954"; + break; + case 0xc308: + case 0xc30d: + model = "OXPCIe958"; + break; + default: + continue; + } + ctlr = malloc(sizeof *ctlr); + if(ctlr == nil){ + print("oxpnp: out of memory\n"); + continue; + } + ctlr->pcidev = p; + ctlr->mem = vmap(p->mem[0].bar & ~0xf, p->mem[0].size); + if(ctlr->mem == nil){ + print("oxpnp: vmap failed\n"); + free(ctlr); + continue; + } + snprint(name, sizeof name, "uartox%d", ctlrno); + kstrdup(&ctlr->name, name); + ctlr->nport = ctlr->mem[Nuart] & 0x1f; + for(i = 0; i < ctlr->nport; ++i){ + port = &ctlr->port[i]; + port->ctlr = ctlr; + port->mem = (u8int *)ctlr->mem + 0x1000 + 0x200*i; + port->regs = port; + snprint(name, sizeof name, "%s.%d", ctlr->name, i); + kstrdup(&port->name, name); + port->phys = &oxphysuart; + if(head == nil) + head = port; + else + tail->next = port; + tail = port; + } + print("%s: %s: %d ports irq %d\n", + ctlr->name, model, ctlr->nport, p->intl); + ctlrno++; + } + return head; +} + +static void +oxinterrupt(Ureg *, void *arg) +{ + Ctlr *ctlr; + Port *port; + Uart *uart; + int i, old; + u8int val; + char ch; + + ctlr = arg; + + ilock(ctlr); + if(!(ctlr->im & ctlr->mem[Gis])){ + iunlock(ctlr); + return; + } + for(i = 0; i < ctlr->nport; ++i){ + if(!(ctlr->im & 1<port[i]; + uart = port; /* "Come Clarity" */ + switch(port->mem[Isr] & 0x3f){ + case 0x06: /* Receiver status error */ + case 0x04: /* Receiver data available */ + case 0x0c: /* Receiver time-out */ + for(;;){ + val = port->mem[Lsr]; + if(!(val & 1<<0)) /* RxRDY */ + break; + if(val & 1<<1) /* Overrun Error */ + uart->oerr++; + if(val & 1<<2) /* Parity Error */ + uart->perr++; + if(val & 1<<3) /* Framing Error */ + uart->ferr++; + ch = port->mem[Rhr]; + if(!(val & 1<<7)) /* Data Error */ + uartrecv(uart, ch); + } + break; + case 0x02: /* Transmitter THR empty */ + uartkick(uart); + break; + case 0x00: /* Modem status change */ + val = port->mem[Msr]; + if(val & 1<<0){ /* Delta nCTS */ + ilock(&uart->tlock); + old = uart->cts; + uart->cts = val & 1<<4; /* CTS */ + if(!old && uart->cts) + uart->ctsbackoff = 2; + iunlock(&uart->tlock); + } + if(val & 1<<1){ /* Delta nDSR */ + old = val & 1<<5; /* DSR */ + if(!old && uart->dsr && uart->hup_dsr) + uart->dohup = 1; + uart->dsr = old; + } + port->ri = val & 1<<6; /* RI */ + if(val & 1<<3){ /* Delta nDCD */ + old = val & 1<<7; /* DCD */ + if(!old && uart->dcd && uart->hup_dcd) + uart->dohup = 1; + uart->dcd = old; + } + break; + } + } + iunlock(ctlr); +} + +#define MASK(p) (1UL<<((p)-(p)->ctlr->port)) + +static void +oxenable(Uart *uart, int) +{ + Ctlr *ctlr; + Port *port; + + port = uart->regs; + ctlr = port->ctlr; + + ilock(ctlr); + if(ctlr->im == 0) + intrenable(ctlr->pcidev->intl, oxinterrupt, ctlr, + ctlr->pcidev->tbdf, ctlr->name); + ctlr->im |= MASK(port); + iunlock(ctlr); + + /* Enable 950 Mode */ + port->mem[Lcr] |= 1<<7; /* Divisor latch access */ + port->mem[Efr] = 1<<4; /* Enhanced mode */ + port->mem[Lcr] &= ~(1<<7); + + port->mem[Ier] = 1<<2|1<<1|1<<0; /* Rx Stat, THRE, RxRDY */ + + (*uart->phys->dtr)(uart, 1); + (*uart->phys->rts)(uart, 1); + + /* Enable FIFO */ + (*uart->phys->fifo)(uart, ~0); +} + +static void +oxdisable(Uart *uart) +{ + Ctlr *ctlr; + Port *port; + + port = uart->regs; + ctlr = port->ctlr; + + (*uart->phys->dtr)(uart, 0); + (*uart->phys->rts)(uart, 0); + (*uart->phys->fifo)(uart, 0); + + port->mem[Ier] = 0; + + ilock(ctlr); + ctlr->im &= ~MASK(port); + if(ctlr->im == 0) + intrdisable(ctlr->pcidev->intl, oxinterrupt, ctlr, + ctlr->pcidev->tbdf, ctlr->name); + iunlock(ctlr); +} + +static void +oxkick(Uart *uart) +{ + Port *port; + + if(uart->cts == 0 || uart->blocked) + return; + + port = uart->regs; + + for(;;){ + if(!(port->mem[Lsr] & 1<<5)) /* THR Empty */ + break; + if(uart->op >= uart->oe && uartstageoutput(uart) == 0) + break; + port->mem[Thr] = *(uart->op++); + } +} + +static void +oxdobreak(Uart *uart, int ms) +{ + Port *port; + + if(ms <= 0) + ms = 200; + + port = uart->regs; + + port->mem[Lcr] |= 1<<6; /* Transmission break */ + if(!waserror()){ + tsleep(&up->sleep, return0, nil, ms); + poperror(); + } + port->mem[Lcr] &= ~(1<<6); +} + +static int +oxbaud(Uart *uart, int baud) +{ + Port *port; + u16int val; + + if(baud <= 0) + return -1; + + port = uart->regs; + + /* + * We aren't terribly interested in non-standard baud rates. + * Rather than mess about with generator constants, we instead + * program DLM and DLL according to Table 37 in the datasheet. + */ + switch(baud){ + case 1200: + val = 0x0cb6; + break; + case 2400: + val = 0x065b; + break; + case 4800: + val = 0x032d; + break; + case 9600: + val = 0x0196; + break; + case 19200: + val = 0x00cb; + break; + case 38400: + val = 0x0066; + break; + case 57600: + val = 0x0044; + break; + case 115200: + val = 0x0022; + break; + default: + return -1; + } + port->mem[Lcr] |= 1<<7; /* Divisor latch access */ + port->mem[Dlm] = val>>8; + port->mem[Dll] = val; + port->mem[Lcr] &= ~(1<<7); + uart->baud = baud; + return 0; +} + +static int +oxbits(Uart *uart, int bits) +{ + Port *port; + u8int val; + + port = uart->regs; + + val = port->mem[Lcr] & 0x7c; + switch(bits){ + case 8: + val |= 0x3; /* Data length */ + break; + case 7: + val |= 0x2; + break; + case 6: + val |= 0x1; + break; + case 5: + break; + default: + return -1; + } + port->mem[Lcr] = val; + uart->bits = bits; + return 0; +} + +static int +oxstop(Uart *uart, int stop) +{ + Port *port; + u8int val; + + port = uart->regs; + + val = port->mem[Lcr] & 0x7b; + switch(stop){ + case 2: + val |= 1<<2; /* Number of Stop Bits */ + break; + case 1: + break; + default: + return -1; + } + port->mem[Lcr] = val; + uart->stop = stop; + return 0; +} + +static int +oxparity(Uart *uart, int parity) +{ + Port *port; + u8int val; + + port = uart->regs; + + val = port->mem[Lcr] & 0x67; + switch(parity){ + case 'e': + val |= 1<<4; /* Even/Odd Parity */ + case 'o': + val |= 1<<3; /* Parity Enable */ + break; + case 'n': + break; + default: + return -1; + } + port->mem[Lcr] = val; + uart->parity = parity; + return 0; +} + +static void +oxmodemctl(Uart *uart, int on) +{ + Ctlr *ctlr; + Port *port; + + port = uart->regs; + ctlr = port->ctlr; + + ilock(ctlr); + ilock(&uart->tlock); + if(on){ + port->mem[Ier] |= 1<<3; /* Modem */ + uart->cts = port->mem[Msr] & 1<<4; /* CTS */ + }else{ + port->mem[Ier] &= ~(1<<3); + uart->cts = 1; + } + uart->modem = on; + iunlock(&uart->tlock); + iunlock(ctlr); +} + +static void +oxrts(Uart *uart, int on) +{ + Port *port; + + port = uart->regs; + + if(on) + port->mem[Mcr] |= 1<<1; /* RTS */ + else + port->mem[Mcr] &= ~(1<<1); + port->rts = on; +} + +static void +oxdtr(Uart *uart, int on) +{ + Port *port; + + port = uart->regs; + + if(on) + port->mem[Mcr] |= 1<<0; /* DTR */ + else + port->mem[Mcr] &= ~(1<<0); + port->dtr = on; +} + +static long +oxstatus(Uart *uart, void *buf, long n, long offset) +{ + Port *port; + + if(offset > 0) + return 0; + + port = uart->regs; + + return snprint(buf, n, + "b%d c%d d%d e%d l%d m%d p%c r%d s%d i%d\n" + "dev(%d) type(%d) framing(%d) overruns(%d) " + "berr(%d) serr(%d)%s%s%s%s\n", + + uart->baud, + uart->hup_dcd, + port->dtr, + uart->hup_dsr, + uart->bits, + uart->modem, + uart->parity, + port->rts, + uart->stop, + port->level, + + uart->dev, + uart->type, + uart->ferr, + uart->oerr, + uart->berr, + uart->serr, + uart->cts ? " cts": "", + uart->dsr ? " dsr": "", + port->ri ? " ring": "", + uart->dcd ? " dcd": "" + ); +} + +static void +oxfifo(Uart *uart, int level) +{ + Ctlr *ctlr; + Port *port; + + port = uart->regs; + ctlr = port->ctlr; + + /* + * 950 Mode FIFOs have a depth of 128 bytes; devuart only + * cares about setting RHR trigger levels. THR trigger + * levels are not supported. + */ + ilock(ctlr); + if(level == 0) + port->mem[Fcr] = 0; /* Disable FIFO */ + else{ + port->mem[Fcr] = 1<<0; /* Enable FIFO */ + switch(level){ + default: + level = 112; + case 112: + port->mem[Fcr] = 0x03<<6|1<<0; /* RHR Trigger Level */ + break; + case 64: + port->mem[Fcr] = 0x02<<6|1<<0; + break; + case 32: + port->mem[Fcr] = 0x01<<6|1<<0; + break; + case 16: + break; + } + } + port->level = level; + iunlock(ctlr); +} + +PhysUart oxphysuart = { + .name = "OXPCIe95x", + .pnp = oxpnp, + .enable = oxenable, + .disable = oxdisable, + .kick = oxkick, + .dobreak = oxdobreak, + .baud = oxbaud, + .bits = oxbits, + .stop = oxstop, + .parity = oxparity, + .modemctl = oxmodemctl, + .rts = oxrts, + .dtr = oxdtr, + .status = oxstatus, + .fifo = oxfifo, +}; --- /sys/src/9/port/alarm.c Thu Dec 8 12:55:02 2005 +++ /sys/src/9/port/alarm.c Sat Aug 3 03:08:09 2013 @@ -16,7 +16,11 @@ for(;;){ now = MACHP(0)->ticks; qlock(&alarms); - while((rp = alarms.head) && rp->alarm <= now){ + /* + * the odd test of now vs. rp->alarm is to cope with + * now wrapping around. + */ + while((rp = alarms.head) && (long)(now - rp->alarm) >= 0){ if(rp->alarm != 0L){ if(canqlock(&rp->debug)){ if(!waserror()){ @@ -48,7 +52,7 @@ p = alarms.head; now = MACHP(0)->ticks; - if(p && p->alarm <= now) + if(p && (long)(now - p->alarm) >= 0) wakeup(&alarmr); } @@ -67,6 +71,8 @@ return old; } when = ms2tk(time)+MACHP(0)->ticks; + if(when == 0) /* ticks have wrapped to 0? */ + when = 1; /* distinguish a wrapped alarm from no alarm */ qlock(&alarms); l = &alarms.head; @@ -82,7 +88,7 @@ if(alarms.head) { l = &alarms.head; for(f = *l; f; f = f->palarm) { - if(f->alarm > when) { + if((long)(f->alarm - when) >= 0) { up->palarm = f; *l = up; goto done; --- /sys/src/9/port/cache.c Tue Sep 15 16:30:54 2009 +++ /sys/src/9/port/cache.c Fri Aug 2 23:35:32 2013 @@ -39,7 +39,7 @@ typedef struct Cache Cache; struct Cache { - Lock; + QLock; int pgno; Mntcache *head; Mntcache *tail; @@ -113,10 +113,10 @@ panic("cinit: no memory"); /* a better algorithm would be nice */ -// if(conf.npage*BY2PG > 200*MB) -// maxcache = 10*MAXCACHE; -// if(conf.npage*BY2PG > 400*MB) -// maxcache = 50*MAXCACHE; + if(conf.npage*BY2PG > 400*MB) + maxcache = 50*MAXCACHE; + else if(conf.npage*BY2PG > 200*MB) + maxcache = 10*MAXCACHE; for(i = 0; i < NFILE-1; i++) { m->next = m+1; @@ -223,14 +223,14 @@ return; h = c->qid.path%NHASH; - lock(&cache); + qlock(&cache); for(m = cache.hash[h]; m; m = m->hash) { if(m->qid.path == c->qid.path) if(m->qid.type == c->qid.type) if(m->dev == c->dev && m->type == c->type) { c->mcp = m; ctail(m); - unlock(&cache); + qunlock(&cache); /* File was updated, invalidate cache */ if(m->qid.vers != c->qid.vers) { @@ -267,7 +267,7 @@ c->mcp = m; e = m->list; m->list = 0; - unlock(&cache); + qunlock(&cache); while(e) { next = e->next; @@ -402,7 +402,7 @@ e->start = offset; e->len = l; - lock(&cache); + qlock(&cache); e->bid = cache.pgno; cache.pgno += BY2PG; /* wrap the counter; low bits are unused by pghash but checked by lookpage */ @@ -413,7 +413,7 @@ }else cache.pgno++; } - unlock(&cache); + qunlock(&cache); p->daddr = e->bid; k = kmap(p); --- /sys/src/9/port/devdraw.c Thu Jun 13 23:24:21 2013 +++ /sys/src/9/port/devdraw.c Fri Aug 2 22:53:45 2013 @@ -252,12 +252,18 @@ devdir(c, q, "draw", 0, eve, 0555, dp); break; case 1: - mkqid(&q, Qwinname, 0, 0); + mkqid(&q, Qwinname, 0, QTFILE); devdir(c, q, "winname", 0, eve, 0444, dp); break; default: return -1; } + return 1; + } + + if(t == Qwinname){ + mkqid(&q, Qwinname, 0, QTFILE); + devdir(c, q, "winname", 0, eve, 0444, dp); return 1; } --- /sys/src/9/port/devmnt.c Sat Sep 26 05:00:43 2009 +++ /sys/src/9/port/devmnt.c Fri Aug 2 23:44:47 2013 @@ -412,6 +412,7 @@ alloc = 1; } wq->clone = nc; + nc->flag |= c->flag&CCACHE; if(waserror()) { mntfree(r); --- /sys/src/9/port/devwd.c Thu Oct 11 00:55:41 2012 +++ /sys/src/9/port/devwd.c Sat Aug 3 01:00:24 2013 @@ -77,13 +77,13 @@ if (wdautopet || !wd || !wdallowed()) return; if (waserror()) { - iprint("watchdog: enable failed\n"); + print("watchdog: enable failed\n"); return; } wd->enable(); poperror(); - iprint("watchdog: on with clock strokes\n"); + print("watchdog: on with clock strokes\n"); wdautopet = watchdogon = 1; if (!wdclock0called) { addclock0link(wdpet, 200); @@ -102,7 +102,7 @@ return; wdautopet = 0; wdshutdown(); - iprint("watchdog: disabled before open\n"); + print("watchdog: disabled before open\n"); } /* @@ -207,7 +207,7 @@ if(strncmp(a, "enable", n) == 0) { if (waserror()) { - iprint("watchdog: enable failed\n"); + print("watchdog: enable failed\n"); nexterror(); } wd->enable(); --- /sys/src/9/port/portdat.h Fri Jul 19 21:25:39 2013 +++ /sys/src/9/port/portdat.h Sat Aug 3 00:10:54 2013 @@ -112,6 +112,7 @@ Proc *head; /* next process waiting for object */ Proc *tail; /* last process waiting for object */ int locked; /* flag */ + uintptr qpc; /* pc of the holder */ }; struct RWlock --- /sys/src/9/port/qlock.c Sun Aug 10 06:19:31 2008 +++ /sys/src/9/port/qlock.c Sat Aug 3 00:10:54 2013 @@ -29,6 +29,7 @@ rwstats.qlock++; if(!q->locked) { q->locked = 1; + q->qpc = getcallerpc(&q); unlock(&q->use); return; } @@ -46,6 +47,7 @@ up->qpc = getcallerpc(&q); unlock(&q->use); sched(); + q->qpc = getcallerpc(&q); } int @@ -58,6 +60,7 @@ return 0; } q->locked = 1; + q->qpc = getcallerpc(&q); unlock(&q->use); return 1; } @@ -81,6 +84,7 @@ return; } q->locked = 0; + q->qpc = 0; unlock(&q->use); } --- /sys/src/cmd/cc/cc.h Wed Apr 24 01:19:17 2013 +++ /sys/src/cmd/cc/cc.h Fri Aug 2 22:36:09 2013 @@ -440,7 +440,7 @@ EXTERN Sym* hash[NHASH]; EXTERN int hasdoubled; EXTERN char* hunk; -EXTERN char* include[20]; +EXTERN char** include; EXTERN Io* iofree; EXTERN Io* ionext; EXTERN Io* iostack; @@ -451,6 +451,7 @@ EXTERN Type* lasttype; EXTERN long lineno; EXTERN long nearln; +EXTERN int maxinclude; EXTERN int nerrors; EXTERN int newflag; EXTERN long nhunk; --- /sys/src/cmd/cc/lex.c Thu May 23 21:00:05 2013 +++ /sys/src/cmd/cc/lex.c Fri Aug 2 22:36:13 2013 @@ -36,8 +36,8 @@ void main(int argc, char *argv[]) { - char *defs[50], *p; - int nproc, nout, status, i, c, ndef; + char **defs, **np, *p; + int nproc, nout, status, i, c, ndef, maxdef; memset(debug, 0, sizeof(debug)); tinit(); @@ -47,9 +47,11 @@ profileflg = 1; /* #pragma can turn it off */ tufield = simplet((1L<etype) | BUNSIGNED); + maxdef = 0; ndef = 0; outfile = 0; - include[ninclude++] = "."; + defs = nil; + setinclude("."); ARGBEGIN { default: c = ARGC(); @@ -73,6 +75,13 @@ case 'D': p = ARGF(); if(p) { + if(ndef >= maxdef){ + maxdef += 50; + np = alloc(maxdef * sizeof *np); + if(defs != nil) + memmove(np, defs, (maxdef - 50) * sizeof *np); + defs = np; + } defs[ndef++] = p; dodefine(p); } @@ -153,7 +162,7 @@ compile(char *file, char **defs, int ndef) { char ofile[400], incfile[20]; - char *p, *av[100], opt[256]; + char *p, **av, opt[256]; int i, c, fd[2]; static int first = 1; @@ -241,6 +250,7 @@ close(fd[0]); mydup(fd[1], 1); close(fd[1]); + av = alloc((3 + ndef + ninclude + 2) * sizeof *av); av[0] = CPP; i = 1; if(debug['.']) @@ -1522,23 +1532,26 @@ setinclude(char *p) { int i; - char *e; + char *e, **np; while(*p != 0) { e = strchr(p, ' '); if(e != 0) *e = '\0'; - for(i=1; i < ninclude; i++) + for(i=0; i < ninclude; i++) if(strcmp(p, include[i]) == 0) break; - if(i >= ninclude) + if(i >= ninclude){ + if(i >= maxinclude){ + maxinclude += 20; + np = alloc(maxinclude * sizeof *np); + if(include != nil) + memmove(np, include, (maxinclude - 20) * sizeof *np); + include = np; + } include[ninclude++] = p; - - if(ninclude > nelem(include)) { - diag(Z, "ninclude too small %d", nelem(include)); - exits("ninclude"); } if(e == 0) --- /sys/src/cmd/fossil/9p.c Tue Apr 3 19:36:09 2012 +++ /sys/src/cmd/fossil/9p.c Sat Aug 3 00:27:41 2013 @@ -867,6 +867,12 @@ qid.type = QTFILE; if(fileIsDir(file)) qid.type = QTDIR; + if(fileIsAppend(file)) + qid.type |= QTAPPEND; + if(fileIsTemporary(file)) + qid.type |= QTTMP; + if(fileIsExclusive(file)) + qid.type |= QTEXCL; qid.vers = fileGetMcount(file); qid.path = fileGetId(file); r->wqid[r->nwqid++] = qid; --- /sys/src/cmd/fossil/file.c Thu Jun 16 21:35:54 2011 +++ /sys/src/cmd/fossil/file.c Sat Aug 3 00:27:41 2013 @@ -961,6 +961,24 @@ } int +fileIsAppend(File *f) +{ + return (f->dir.mode & ModeAppend) != 0; +} + +int +fileIsExclusive(File *f) +{ + return (f->dir.mode & ModeExclusive) != 0; +} + +int +fileIsTemporary(File *f) +{ + return (f->dir.mode & ModeTemporary) != 0; +} + +int fileIsRoot(File *f) { return f == f->fs->file; --- /sys/src/cmd/fossil/fs.h Thu Jun 16 21:35:58 2011 +++ /sys/src/cmd/fossil/fs.h Sat Aug 3 00:27:41 2013 @@ -45,6 +45,9 @@ int fileGetSize(File*, uvlong*); File *fileIncRef(File*); int fileIsDir(File*); +int fileIsTemporary(File*); +int fileIsAppend(File*); +int fileIsExclusive(File*); int fileIsRoFs(File*); int fileIsRoot(File*); int fileMapBlock(File*, ulong, uchar[VtScoreSize], ulong); --- /sys/src/cmd/import.c Fri May 9 20:10:31 2008 +++ /sys/src/cmd/import.c Sat Aug 3 00:05:49 2013 @@ -92,11 +92,12 @@ main(int argc, char **argv) { char *mntpt, *srvpost, srvfile[64]; - int backwards = 0, fd, mntflags, oldserver; + int backwards = 0, fd, mntflags, oldserver, notree; quotefmtinstall(); srvpost = nil; oldserver = 0; + notree = 0; mntflags = MREPL; ARGBEGIN{ case 'A': @@ -145,6 +146,9 @@ case 'B': backwards = 1; break; + case 'm': + notree = 1; + break; default: usage(); }ARGEND; @@ -164,6 +168,8 @@ mntpt = argv[1]; break; case 3: + if(notree) + usage(); mntpt = argv[2]; break; default: @@ -179,6 +185,8 @@ if(backwards) fd = passive(); + else if(notree) + fd = connect(argv[0], nil, oldserver); else fd = connect(argv[0], argv[1], oldserver); @@ -312,20 +320,22 @@ sysfatal("%r: %s", system); } - procsetname("writing tree name %s", tree); - n = write(fd, tree, strlen(tree)); - if(n < 0) - sysfatal("can't write tree: %r"); - - strcpy(buf, "can't read tree"); - - procsetname("awaiting OK for %s", tree); - n = read(fd, buf, sizeof buf - 1); - if(n!=2 || buf[0]!='O' || buf[1]!='K'){ - if (timedout) - sysfatal("timed out connecting to %s", na); - buf[sizeof buf - 1] = '\0'; - sysfatal("bad remote tree: %s", buf); + if(tree != nil){ + procsetname("writing tree name %s", tree); + n = write(fd, tree, strlen(tree)); + if(n < 0) + sysfatal("can't write tree: %r"); + + strcpy(buf, "can't read tree"); + + procsetname("awaiting OK for %s", tree); + n = read(fd, buf, sizeof buf - 1); + if(n!=2 || buf[0]!='O' || buf[1]!='K'){ + if (timedout) + sysfatal("timed out connecting to %s", na); + buf[sizeof buf - 1] = '\0'; + sysfatal("bad remote tree: %s", buf); + } } if(oldserver) @@ -362,7 +372,7 @@ void usage(void) { - fprint(2, "usage: import [-abcC] [-A] [-E clear|ssl|tls] " + fprint(2, "usage: import [-abcCm] [-A] [-E clear|ssl|tls] " "[-e 'crypt auth'|clear] [-k keypattern] [-p] host remotefs [mountpoint]\n"); exits("usage"); } --- /sys/src/cmd/usb/serial/ftdi.c Tue Feb 8 00:23:35 2011 +++ /sys/src/cmd/usb/serial/ftdi.c Fri Aug 2 23:20:54 2013 @@ -201,6 +201,7 @@ { PAPOUCHVid, PAPOUCHTMUDid }, { FTVid, FTACGHFDUALDid }, { FT8U232AMDid, FT4232HDid }, + { FTVid, AMONKEYDid }, { 0, 0 }, }; --- /sys/src/cmd/usb/serial/ftdi.h Wed Jan 5 23:28:19 2011 +++ /sys/src/cmd/usb/serial/ftdi.h Fri Aug 2 23:20:54 2013 @@ -386,6 +386,10 @@ */ FT4232HDid = 0x6011, /* FTDI FT4232H based device */ + /* + * Amontec JTAGkey (http://www.amontec.com/) + */ + AMONKEYDid = 0xCFF8, }; /* Commands */ --- /sys/src/cmd/vnc/draw.c Mon Feb 10 13:39:09 2003 +++ /sys/src/cmd/vnc/draw.c Fri Aug 2 23:58:11 2013 @@ -106,6 +106,7 @@ static void updatescreen(Rectangle r) { + Image* img; int b, bb; lockdisplay(display); @@ -120,10 +121,15 @@ /* * assume load image fails only because of resize */ + img = allocimage(display, r, screen->chan, 0, DNofill); + if(img == nil) + sysfatal("updatescreen: %r"); b = Dx(r) * pixb * Dy(r); - bb = loadimage(screen, rectaddpt(r, screen->r.min), pixbuf, b); + bb = loadimage(img, r, pixbuf, b); if(bb != b && verbose) fprint(2, "loadimage %d on %R for %R returned %d: %r\n", b, rectaddpt(r, screen->r.min), screen->r, bb); + draw(screen, rectaddpt(r, screen->r.min), img, nil, r.min); + freeimage(img); unlockdisplay(display); } --- /sys/src/games/life.c Thu Aug 27 20:11:18 2009 +++ /sys/src/games/life.c Fri Aug 2 22:44:47 2013 @@ -30,6 +30,7 @@ int col[NLIFE]; char action[18]; /* index by cell contents to find action */ char *adjust[NADJUST]; +int delay; Point cen; Image *box; @@ -100,9 +101,15 @@ while (ecanmouse()) emouse(); /* throw away mouse events */ - while (ecankbd()) - if ((c = ekbd()) == 'q' || c == 0177) /* watch keyboard ones */ + while (ecankbd()){ + c = ekbd(); + if (c == 'q' || c == 0177) /* watch keyboard ones */ exits(nil); + if (c >= '1' && c <= '9') + delay = (c - '0') * 100; + else if (c == '0') + delay = 1000; + } if (needresize) reshape(); } @@ -110,8 +117,7 @@ void main(int argc, char *argv[]) { - int delay = 1000; - + delay = 1000; setrules(".d.d..b..d.d.d.d.d"); /* regular rules */ ARGBEGIN { case '3': --- /sys/src/libdraw/font.c Sat Dec 15 00:01:10 2007 +++ /sys/src/libdraw/font.c Sat Aug 3 00:52:49 2013 @@ -129,7 +129,8 @@ if(s->age){ if(s->agecf->name != nil){ /* clean up */ - if(s->f != display->defaultsubfont) + if(display && + s->f != display->defaultsubfont) freesubfont(s->f); s->cf = nil; s->f = nil; --- /sys/src/libmach/5db.c Fri Jan 25 01:25:32 2013 +++ /sys/src/libmach/5db.c Fri Aug 2 23:05:24 2013 @@ -61,7 +61,7 @@ */ Machdata armmach = { - {0x70, 0x00, 0x20, 0xD1}, /* break point */ /* D1200070 */ + {0x70, 0x00, 0x20, 0xE1}, /* break point */ /* E1200070 */ 4, /* break point size */ leswab, /* short to local byte order */ @@ -247,14 +247,14 @@ op = 108; break; case 7: - if(((w >> 19) & 0x1) == 0) + if(((w >> 19) & 0x1) == 0){ if(((w >> 17) & 0x1) == 0) op = 109 + ((w >> 16) & 0x4) + ((w >> 15) & 0x2) + ((w >> 7) & 0x1); else if(((w >> 16) & 0x7) == 0x7) op = 117; - else + }else switch((w >> 16) & 0x7){ case 0: case 4: @@ -405,6 +405,16 @@ return; } } + if(i->rd == 15) { + if(i->op == 120) { + format("MOVW", i, "PSR, %x"); + return; + } else + if(i->op == 121) { + format("MOVW", i, "%x, PSR"); + return; + } + } format(o->o, i, o->a); } @@ -591,7 +601,7 @@ case 10: return n == v; case 11: return n != v; case 12: return !z && (n == v); - case 13: return z && (n != v); + case 13: return z || (n != v); case 14: return 1; case 15: return 0; }