use u32int for portable h/w sizes rather than ulong. Notes: Sun Mar 11 16:24:38 EDT 2012 geoff on plan9, ulong is guaranteed to be 32-bits on all architectures. Reference: /n/sources/patch/sorry/usb32int Date: Sat Mar 10 18:27:14 CET 2012 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/9/port/portusbehci.h Sat Mar 10 18:26:54 2012 +++ /sys/src/9/port/portusbehci.h Sat Mar 10 18:26:53 2012 @@ -126,10 +126,10 @@ */ struct Ecapio { - ulong cap; /* 00 controller capability register */ - ulong parms; /* 04 structural parameters register */ - ulong capparms; /* 08 capability parameters */ - ulong portroute; /* 0c not on the CS5536 */ + u32int cap; /* 00 controller capability register */ + u32int parms; /* 04 structural parameters register */ + u32int capparms; /* 08 capability parameters */ + u32int portroute; /* 0c not on the CS5536 */ }; /* @@ -137,8 +137,8 @@ */ struct Edbgio { - ulong csw; /* control and status */ - ulong pid; /* USB pid */ + u32int csw; /* control and status */ + u32int pid; /* USB pid */ uchar data[8]; /* data buffer */ - ulong addr; /* device and endpoint addresses */ + u32int addr; /* device and endpoint addresses */ }; --- /sys/src/9/kw/usbehcikw.c Sat Mar 10 18:26:57 2012 +++ /sys/src/9/kw/usbehcikw.c Sat Mar 10 18:26:56 2012 @@ -328,7 +328,7 @@ capio = ctlr->capio; hp->nports = capio->parms & Cnports; - ddprint("echi: %s, ncc %lud npcc %lud\n", + ddprint("echi: %s, ncc %ud npcc %ud\n", capio->parms & 0x10000 ? "leds" : "no leds", (capio->parms >> 12) & 0xf, (capio->parms >> 8) & 0xf); ddprint("ehci: routing %s, %sport power ctl, %d ports\n", --- /sys/src/9/pc/usbehcipc.c Sat Mar 10 18:27:00 2012 +++ /sys/src/9/pc/usbehcipc.c Sat Mar 10 18:26:58 2012 @@ -228,8 +228,11 @@ static Lock resetlck; s = getconf("*maxehci"); - if (s != nil && s[0] >= '0' && s[0] <= '9') - maxehci = atoi(s); + if(s != nil){ + i = strtoul(s, &s, 0); + if(*s == 0) + maxehci = i; + } if(maxehci == 0 || getconf("*nousbehci")) return -1; @@ -262,7 +265,7 @@ capio = ctlr->capio; hp->nports = capio->parms & Cnports; - ddprint("echi: %s, ncc %lud npcc %lud\n", + ddprint("echi: %s, ncc %ud npcc %ud\n", capio->parms & 0x10000 ? "leds" : "no leds", (capio->parms >> 12) & 0xf, (capio->parms >> 8) & 0xf); ddprint("ehci: routing %s, %sport power ctl, %d ports\n",