diff --git a/rootfs.manifest b/rootfs.manifest index 6af5da5..d4bc376 100644 --- a/rootfs.manifest +++ b/rootfs.manifest @@ -582,7 +582,6 @@ file /sbin/chown file /sbin/chroot mode 04755 file /sbin/cron -file /sbin/devupdate file /sbin/disktool file /sbin/fdisk file /sbin/fsck @@ -743,20 +742,27 @@ file /include/grp.h file /include/kmem.h file /include/lastlog.h file /include/limits.h +file /include/machine/adc.h file /include/machine/cpu.h +file /include/machine/debug.h file /include/machine/elf_machdep.h file /include/machine/float.h file /include/machine/io.h file /include/machine/limits.h file /include/machine/machparam.h +file /include/machine/mrams.h file /include/machine/pic32mx.h -file /include/machine/rd_sdramp_config.h file /include/machine/sdram.h +file /include/machine/sdramp.h +file /include/machine/sdramp_config.h +file /include/machine/sramc.h +file /include/machine/uart.h file /include/machine/usb_ch9.h file /include/machine/usb_device.h file /include/machine/usb_function_cdc.h file /include/machine/usb_function_hid.h file /include/machine/usb_hal_pic32.h +file /include/machine/usb_uart.h file /include/math.h file /include/mtab.h file /include/ndbm.h @@ -785,13 +791,11 @@ file /include/stdlib.h file /include/string.h file /include/strings.h file /include/struct.h -file /include/sys/adc.h file /include/sys/buf.h file /include/syscall.h file /include/sys/callout.h file /include/sys/clist.h file /include/sys/conf.h -file /include/sys/debug.h file /include/sys/dir.h file /include/sys/disk.h file /include/sys/dkbad.h @@ -821,10 +825,6 @@ file /include/sys/picga.h file /include/sys/proc.h file /include/sys/ptrace.h file /include/sys/pty.h -file /include/sys/rd_flash.h -file /include/sys/rd_mrams.h -file /include/sys/rd_sdramp.h -file /include/sys/rd_sramc.h file /include/sys/reboot.h file /include/sys/resource.h file /include/sys/select.h @@ -842,9 +842,7 @@ file /include/sys/ttychars.h file /include/sys/ttydev.h file /include/sys/tty.h file /include/sys/types.h -file /include/sys/uart.h file /include/sys/uio.h -file /include/sys/usb_uart.h file /include/sys/user.h file /include/sys/utsname.h file /include/sys/vm.h diff --git a/src/cmd/Makefile b/src/cmd/Makefile index 77c5b25..0031d6d 100644 --- a/src/cmd/Makefile +++ b/src/cmd/Makefile @@ -11,7 +11,7 @@ CFLAGS += -Werror # Programs that live in subdirectories, and have makefiles of their own. # /bin SUBDIR = adb adc-demo aout ar as awk basic calendar cc chflags \ - chpass cpp dc devupdate diff emg env fdisk find fold forth \ + chpass cpp dc diff emg env fdisk find fold forth \ fstat glcdtest hostname id la lcc lcpp ld ls login make \ man md5 med more nm passwd pdc picoc portio printf pwm \ ranlib re renice retroforth scm sed setty sh sl smallc \ diff --git a/src/cmd/adc-demo/adc-demo.c b/src/cmd/adc-demo/adc-demo.c index 4d37023..cde1ede 100644 --- a/src/cmd/adc-demo/adc-demo.c +++ b/src/cmd/adc-demo/adc-demo.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include int fd[16]; diff --git a/sys/include/conf.h b/sys/include/conf.h index 5acbb51..d541247 100644 --- a/sys/include/conf.h +++ b/sys/include/conf.h @@ -9,11 +9,6 @@ struct uio; struct buf; struct tty; -struct devspec { - int unit; - char *devname; -}; - /* * Declaration of block device * switch. Each entry (row) is @@ -30,7 +25,6 @@ struct bdevsw void (*d_strategy) (struct buf*); daddr_t (*d_psize) (dev_t); /* query partition size */ int (*d_ioctl) (dev_t, u_int, caddr_t, int); - const struct devspec *devs; int d_flags; /* tape flag */ }; @@ -52,7 +46,6 @@ struct cdevsw void (*d_strategy) (struct buf*); char (*r_read) (dev_t); void (*r_write) (dev_t, char); - const struct devspec *devs; }; #define UART_MAJOR 6 diff --git a/sys/include/glcd.h b/sys/include/glcd.h index 7721d3c..64e42bc 100644 --- a/sys/include/glcd.h +++ b/sys/include/glcd.h @@ -137,8 +137,6 @@ struct glcd_command { #ifdef KERNEL #include "conf.h" -extern const struct devspec glcddevs[]; - extern int glcd_open (dev_t dev, int flag, int mode); extern int glcd_close (dev_t dev, int flag, int mode); extern int glcd_read (dev_t dev, struct uio *uio, int flag); diff --git a/sys/include/gpio.h b/sys/include/gpio.h index 528c140..ff3f9e6 100644 --- a/sys/include/gpio.h +++ b/sys/include/gpio.h @@ -40,8 +40,6 @@ #include "conf.h" -extern const struct devspec gpiodevs[]; - int gpioopen (dev_t dev, int flag, int mode); int gpioclose (dev_t dev, int flag, int mode); int gpioread (dev_t dev, struct uio *uio, int flag); diff --git a/sys/include/picga.h b/sys/include/picga.h index c492719..8c28347 100644 --- a/sys/include/picga.h +++ b/sys/include/picga.h @@ -85,8 +85,6 @@ struct charval { #ifdef KERNEL #include "conf.h" -extern const struct devspec picgadevs[]; - extern void picga_command(unsigned char cmd, unsigned char len, void *data); extern int picga_open(dev_t dev, int flag, int mode); extern int picga_close(dev_t dev, int flag, int mode); diff --git a/sys/include/pty.h b/sys/include/pty.h index 6aeecbc..0d1680c 100644 --- a/sys/include/pty.h +++ b/sys/include/pty.h @@ -15,9 +15,6 @@ #include "tty.h" #include "conf.h" -extern const struct devspec ptsdevs[]; -extern const struct devspec ptcdevs[]; - #ifndef PTY_NUNITS #define PTY_NUNITS 4 /* 4 units by default */ #endif diff --git a/sys/include/pwm.h b/sys/include/pwm.h index 8fe5f83..369fe65 100644 --- a/sys/include/pwm.h +++ b/sys/include/pwm.h @@ -18,8 +18,6 @@ struct pwm_state { #ifdef KERNEL #include "conf.h" -extern const struct devspec pwmdevs[]; - extern int pwm_open (dev_t dev, int flag, int mode); extern int pwm_close (dev_t dev, int flag, int mode); extern int pwm_read (dev_t dev, struct uio *uio, int flag); diff --git a/sys/include/rd_flash.h b/sys/include/rd_flash.h deleted file mode 100644 index f75e972..0000000 --- a/sys/include/rd_flash.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _RD_FLASH_H -#define _RD_FLASH_H - -#ifdef KERNEL - -extern int flash_read(int unit, unsigned int offset, char *data, unsigned int bcount); -extern int flash_write(int unit, unsigned int offset, char *data, unsigned int bcount); -extern int flash_open(int unit, int flag, int mode); -extern int flash_size(int unit); -extern void flash_init(int unit, int flag); - -#endif - -#endif diff --git a/sys/include/skel.h b/sys/include/skel.h index c483e65..a4dd375 100644 --- a/sys/include/skel.h +++ b/sys/include/skel.h @@ -33,8 +33,6 @@ #ifdef KERNEL #include "conf.h" -extern const struct devspec skeldevs[]; - int skeldev_open (dev_t dev, int flag, int mode); int skeldev_close (dev_t dev, int flag, int mode); int skeldev_read (dev_t dev, struct uio *uio, int flag); diff --git a/sys/include/spi.h b/sys/include/spi.h index 87f6fb3..36209c0 100644 --- a/sys/include/spi.h +++ b/sys/include/spi.h @@ -84,8 +84,6 @@ int spidev_read (dev_t dev, struct uio *uio, int flag); int spidev_write (dev_t dev, struct uio *uio, int flag); int spidev_ioctl (dev_t dev, u_int cmd, caddr_t addr, int flag); -extern const struct devspec spidevs[]; - #endif #endif diff --git a/sys/include/swap.h b/sys/include/swap.h index 6fe9485..0ca7375 100644 --- a/sys/include/swap.h +++ b/sys/include/swap.h @@ -21,9 +21,6 @@ extern int swcioctl (dev_t dev, register u_int cmd, caddr_t addr, int flag); extern int swcopen(dev_t dev, int mode, int flag); extern int swcclose(dev_t dev, int mode, int flag); -extern const struct devspec swapbdevs[]; -extern const struct devspec swapcdevs[]; - #endif #endif diff --git a/sys/include/systm.h b/sys/include/systm.h index f0654e3..5967000 100644 --- a/sys/include/systm.h +++ b/sys/include/systm.h @@ -244,12 +244,6 @@ int cnwrite (dev_t dev, struct uio *uio, int flag); int cnioctl (dev_t dev, u_int cmd, caddr_t addr, int flag); int cnselect (dev_t dev, int rw); -extern const struct devspec cndevs[]; -extern const struct devspec mmdevs[]; -extern const struct devspec sydevs[]; -extern const struct devspec logdevs[]; -extern const struct devspec fddevs[]; - #ifdef TS_ISOPEN extern struct tty cnttys[]; #endif diff --git a/sys/kernel/exec_aout.c b/sys/kernel/exec_aout.c index 89cbff2..835d55c 100644 --- a/sys/kernel/exec_aout.c +++ b/sys/kernel/exec_aout.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include int exec_aout_check(struct exec_params *epp) { diff --git a/sys/kernel/exec_subr.c b/sys/kernel/exec_subr.c index 998e755..68f3db2 100644 --- a/sys/kernel/exec_subr.c +++ b/sys/kernel/exec_subr.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include /* * How memory is set up. diff --git a/sys/kernel/kern_descrip.c b/sys/kernel/kern_descrip.c index c35e4a4..a99d5d2 100644 --- a/sys/kernel/kern_descrip.c +++ b/sys/kernel/kern_descrip.c @@ -18,13 +18,6 @@ #endif #include -const struct devspec fddevs[] = { - { 0, "stdin" }, - { 1, "stdout" }, - { 2, "stderr" }, - { 0, 0 } -}; - /* * Descriptor management. */ diff --git a/sys/kernel/kern_exec.c b/sys/kernel/kern_exec.c index 95530f5..f942cdf 100644 --- a/sys/kernel/kern_exec.c +++ b/sys/kernel/kern_exec.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include /* * exec system call, with and without environments. diff --git a/sys/kernel/tty_tty.c b/sys/kernel/tty_tty.c index 63774a4..0e2a3e3 100644 --- a/sys/kernel/tty_tty.c +++ b/sys/kernel/tty_tty.c @@ -17,11 +17,6 @@ #include #include -const struct devspec sydevs[] = { - { 0, "tty" }, - { 0, 0 } -}; - /*ARGSUSED*/ int syopen (dev, flag) diff --git a/sys/kernel/vm_sched.c b/sys/kernel/vm_sched.c index 72aa3ee..fcd86c1 100644 --- a/sys/kernel/vm_sched.c +++ b/sys/kernel/vm_sched.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #define MINFINITY -32767 /* minus infinity */ diff --git a/sys/pic32/adc.c b/sys/pic32/adc.c index 492052e..01ea82d 100644 --- a/sys/pic32/adc.c +++ b/sys/pic32/adc.c @@ -27,18 +27,10 @@ #include #include #include -#include -#include +#include +#include #include -const struct devspec adcdevs[] = { - { 0, "adc0" }, { 1, "adc1" }, { 2, "adc2" }, { 3, "adc3" }, - { 4, "adc4" }, { 5, "adc5" }, { 6, "adc6" }, { 7, "adc7" }, - { 8, "adc8" }, { 9, "adc9" }, { 10, "adc10" }, { 11, "adc11" }, - { 12, "adc12" }, { 13, "adc13" }, { 14, "adc14" }, { 15, "adc15" }, - { 0, 0 } -}; - extern int uwritec(struct uio *); unsigned short adcactive = 0; diff --git a/sys/include/adc.h b/sys/pic32/adc.h similarity index 91% rename from sys/include/adc.h rename to sys/pic32/adc.h index dbe1ff8..5d779f9 100644 --- a/sys/include/adc.h +++ b/sys/pic32/adc.h @@ -15,10 +15,6 @@ #define ADCMAX 15 #ifdef KERNEL -#include "conf.h" - -extern const struct devspec adcdevs[]; - int adc_open (dev_t dev, int flag, int mode); int adc_close (dev_t dev, int flag, int mode); int adc_read (dev_t dev, struct uio *uio, int flag); diff --git a/sys/pic32/cons.c b/sys/pic32/cons.c index af38ae6..2b40650 100644 --- a/sys/pic32/cons.c +++ b/sys/pic32/cons.c @@ -11,14 +11,8 @@ #include #include #include - -#include -#include - -const struct devspec cndevs[] = { - { 0, "console" }, - { 0, 0 } -}; +#include +#include dev_t console_device = -1; diff --git a/sys/include/debug.h b/sys/pic32/debug.h similarity index 100% rename from sys/include/debug.h rename to sys/pic32/debug.h diff --git a/sys/pic32/devsw.c b/sys/pic32/devsw.c index e0b35a3..148fe3d 100644 --- a/sys/pic32/devsw.c +++ b/sys/pic32/devsw.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -26,11 +26,23 @@ extern int strcmp(char *s1, char *s2); #ifdef SD_ENABLED # include #endif +#ifdef SRAMC_ENABLED +# include +#endif +#ifdef SDRAMP_ENABLED +# include +#endif +#ifdef MRAMS_ENABLED +# include +#endif +#ifdef SPIRAMS_ENABLED +# include +#endif #ifdef UARTUSB_ENABLED -# include +# include #endif #ifdef ADC_ENABLED -# include +# include #endif #ifdef GLCD_ENABLED # include @@ -45,7 +57,7 @@ extern int strcmp(char *s1, char *s2); # include #endif #ifdef HXTFT_ENABLED -# include +# include #endif #ifdef SKEL_ENABLED # include @@ -95,7 +107,7 @@ daddr_t nosize(dev) #define NOBDEV \ noopen, noopen, nostrategy, \ - nosize, noioctl, 0 + nosize, noioctl, /* * The RetroDisks require the same master number as the disk entry in the @@ -106,23 +118,46 @@ const struct bdevsw bdevsw[] = { { /* 0 - sd */ #ifdef SD_ENABLED sdopen, sdclose, sdstrategy, - sdsize, sdioctl, sddevs + sdsize, sdioctl, #else NOBDEV #endif }, -{ /* 1 - rd1 */ +{ /* 1 - sramc */ +#ifdef SRAMC_ENABLED + sramc_open, sramc_close, sramc_strategy, + sramc_size, sramc_ioctl, +#else NOBDEV +#endif }, -{ /* 2 - rd2 */ +{ /* 2 - sdramp */ +#ifdef SDRAMP_ENABLED + sdramp_open, sdramp_close, sdramp_strategy, + sdramp_size, sdramp_ioctl, +#else NOBDEV +#endif }, -{ /* 3 - rd3 */ +{ /* 3 - mrams */ +#ifdef MRAMS_ENABLED + mrams_open, mrams_close, mrams_strategy, + mrams_size, mrams_ioctl, +#else NOBDEV +#endif }, { /* 4 - swap */ swopen, swclose, swstrategy, - swsize, swcioctl, swapbdevs + swsize, swcioctl, +}, +{ /* 5 - spirams */ +#ifdef SPIRAMS_ENABLED + spirams_open, spirams_close, spirams_strategy, + spirams_size, spirams_ioctl, +#else + NOBDEV +#endif }, { 0 }, @@ -133,7 +168,7 @@ const int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]) - 1; #define NOCDEV \ noopen, noopen, norw, norw, \ noioctl, nulldev, 0, seltrue, \ - nostrategy, 0, 0, 0 + nostrategy, 0, 0, const struct cdevsw cdevsw[] = { @@ -143,7 +178,7 @@ const struct cdevsw cdevsw[] = { { /* 0 - console */ cnopen, cnclose, cnread, cnwrite, cnioctl, nulldev, cnttys, cnselect, - nostrategy, 0, 0, cndevs + nostrategy, 0, 0, }, { /* 1 - mem, kmem, null, zero */ #if MEM_MAJOR != 1 @@ -151,22 +186,22 @@ const struct cdevsw cdevsw[] = { #endif nulldev, nulldev, mmrw, mmrw, noioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, mmdevs + nostrategy, 0, 0, }, { /* 2 - tty */ syopen, nulldev, syread, sywrite, syioctl, nulldev, 0, syselect, - nostrategy, 0, 0, sydevs + nostrategy, 0, 0, }, { /* 3 - fd */ fdopen, nulldev, norw, norw, noioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, fddevs + nostrategy, 0, 0, }, { /* 4 - temp (temporary allocation in swap space) */ swcopen, swcclose, swcread, swcwrite, swcioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, swapcdevs + nostrategy, 0, 0, }, /* @@ -176,7 +211,7 @@ const struct cdevsw cdevsw[] = { #ifdef LOG_ENABLED logopen, logclose, logread, norw, logioctl, nulldev, 0, logselect, - nostrategy, 0, 0, logdevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -190,7 +225,7 @@ const struct cdevsw cdevsw[] = { defined(UART5_ENABLED) || defined(UART6_ENABLED) uartopen, uartclose, uartread, uartwrite, uartioctl, nulldev, uartttys, uartselect, - nostrategy, uartgetc, uartputc, uartdevs + nostrategy, uartgetc, uartputc, #else NOCDEV #endif @@ -202,7 +237,7 @@ const struct cdevsw cdevsw[] = { #ifdef UARTUSB_ENABLED usbopen, usbclose, usbread, usbwrite, usbioctl, nulldev, usbttys, usbselect, - nostrategy, usbgetc, usbputc, usbdevs + nostrategy, usbgetc, usbputc, #else NOCDEV #endif @@ -211,11 +246,11 @@ const struct cdevsw cdevsw[] = { #ifdef PTY_ENABLED ptsopen, ptsclose, ptsread, ptswrite, ptyioctl, nulldev, pt_tty, ptcselect, - nostrategy, 0, 0, ptsdevs + nostrategy, 0, 0, }, { ptcopen, ptcclose, ptcread, ptcwrite, ptyioctl, nulldev, pt_tty, ptcselect, - nostrategy, 0, 0, ptcdevs + nostrategy, 0, 0, #else NOCDEV }, { NOCDEV #endif @@ -227,7 +262,7 @@ const struct cdevsw cdevsw[] = { defined(GPIO6_ENABLED) gpioopen, gpioclose, gpioread, gpiowrite, gpioioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, gpiodevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -236,7 +271,7 @@ const struct cdevsw cdevsw[] = { #ifdef ADC_ENABLED adc_open, adc_close, adc_read, adc_write, adc_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, adcdevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -246,7 +281,7 @@ const struct cdevsw cdevsw[] = { defined(SPI3_ENABLED) || defined(SPI4_ENABLED) spidev_open, spidev_close, spidev_read, spidev_write, spidev_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, spidevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -255,7 +290,7 @@ const struct cdevsw cdevsw[] = { #ifdef GLCD_ENABLED glcd_open, glcd_close, glcd_read, glcd_write, glcd_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, glcddevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -264,7 +299,7 @@ const struct cdevsw cdevsw[] = { #ifdef PWM_ENABLED pwm_open, pwm_close, pwm_read, pwm_write, pwm_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, pwmdevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -273,7 +308,7 @@ const struct cdevsw cdevsw[] = { #ifdef PICGA_ENABLED picga_open, picga_close, picga_read, picga_write, picga_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, picgadevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -285,7 +320,7 @@ const struct cdevsw cdevsw[] = { #ifdef HXTFT_ENABLED hx8357_open, hx8357_close, hx8357_read, hx8357_write, hx8357_ioctl, nulldev, hx8357_ttys, hx8357_select, - nostrategy, hx8357_getc, hx8357_putc, hx8357devs + nostrategy, hx8357_getc, hx8357_putc, #else NOCDEV #endif @@ -294,7 +329,7 @@ const struct cdevsw cdevsw[] = { #ifdef SKEL_ENABLED skeldev_open, skeldev_close, skeldev_read, skeldev_write, skeldev_ioctl, nulldev, 0, seltrue, - nostrategy, 0, 0, skeldevs + nostrategy, 0, 0, #else NOCDEV #endif @@ -357,22 +392,3 @@ chrtoblk(dev_t dev) { return NODEV; } - -#if 0 -char *cdevname(dev_t dev) -{ - int maj = major(dev); - const struct devspec *devs = cdevsw[maj].devs; - int i; - - if (! devs) - return 0; - - for (i=0; devs[i].devname != 0; i++) { - if (devs[i].unit == minor(dev)) { - return devs[i].devname; - } - } - return 0; -} -#endif diff --git a/sys/pic32/exception.c b/sys/pic32/exception.c index 7b9e90c..db15df3 100644 --- a/sys/pic32/exception.c +++ b/sys/pic32/exception.c @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include //#define TRACE_EXCEPTIONS diff --git a/sys/pic32/files.kconf b/sys/pic32/files.kconf index 9cd7db0..c0943a1 100644 --- a/sys/pic32/files.kconf +++ b/sys/pic32/files.kconf @@ -76,11 +76,11 @@ pic32/hx8357.c optional hxtft pic32/picga.c optional picga pic32/power_control.c optional power pic32/pwm.c optional pwm -pic32/rd_mrams.c optional mrams +pic32/mrams.c optional mrams pic32/sd.c optional sd -pic32/rd_sdramp.c optional sdramp -pic32/rd_spirams.c optional spirams -pic32/rd_sramc.c optional sramc +pic32/sdramp.c optional sdramp +pic32/spirams.c optional spirams +pic32/sramc.c optional sramc pic32/sdram.S optional sdramp pic32/skel.c optional skel pic32/spi.c optional spi diff --git a/sys/pic32/glcd.c b/sys/pic32/glcd.c index 3883974..ded4aa2 100644 --- a/sys/pic32/glcd.c +++ b/sys/pic32/glcd.c @@ -31,11 +31,6 @@ #include #include -const struct devspec glcddevs[] = { - { 0, "glcd0" }, - { 0, 0 } -}; - #define _BC(R,B) (R &= ~(1< #include -const struct devspec gpiodevs[] = { - { 0, "porta" }, { 1, "portb" }, { 2, "portc" }, { 3, "portd" }, - { 4, "porte" }, { 5, "portf" }, { 6, "portg" }, - - { 64, "confa" }, { 65, "confb" }, { 66, "confc" }, { 67, "confd" }, - { 68, "confe" }, { 69, "conff" }, { 70, "confg" }, - - { 0, 0 } -}; - - /* * Devices: * /dev/porta ... /dev/portg diff --git a/sys/pic32/hx8357.c b/sys/pic32/hx8357.c index 45a28ef..54acaab 100644 --- a/sys/pic32/hx8357.c +++ b/sys/pic32/hx8357.c @@ -27,10 +27,9 @@ #include #include #include -#include -#include +#include #include -#include +#include #include char frame[40][80]; @@ -94,12 +93,6 @@ const unsigned char *font = Default; const unsigned char _font_width = 6; const unsigned char _font_height = 8; -const struct devspec hx8357devs[] = { - { 0, "tft0" }, - { 1, "tftin0" }, - { 0, 0 } -}; - void inline static writeCommand(unsigned short c) { while (PMMODE & PIC32_PMMODE_BUSY); diff --git a/sys/include/hx8357.h b/sys/pic32/hx8357.h similarity index 76% rename from sys/include/hx8357.h rename to sys/pic32/hx8357.h index accb269..57a1722 100644 --- a/sys/include/hx8357.h +++ b/sys/pic32/hx8357.h @@ -1,14 +1,11 @@ #ifndef _HX8356_H #define _HX8357_H -#include "tty.h" - -extern const struct devspec hx8357devs[]; extern int hx8357_open(dev_t dev, int flag, int mode); extern int hx8357_close(dev_t dev, int flag, int mode); extern int hx8357_read(dev_t dev, struct uio *uio, int flag); extern int hx8357_write(dev_t dev, struct uio *uio, int flag); -extern int hx8357_ioctl(dev_t dev, register u_int cmd, caddr_t addr, int flag); +extern int hx8357_ioctl(dev_t dev, u_int cmd, caddr_t addr, int flag); extern int hx8357_select(dev_t dev, int rw); extern void hx8357_putc(dev_t dev, char c); extern char hx8357_getc(dev_t dev); diff --git a/sys/pic32/machdep.c b/sys/pic32/machdep.c index 546642c..6cfa1c5 100644 --- a/sys/pic32/machdep.c +++ b/sys/pic32/machdep.c @@ -19,17 +19,17 @@ #include #include #include -#include #include -#include -#include +#include +#include +#include #ifdef UARTUSB_ENABLED # include # include #endif #ifdef HX8357_ENABLED -#include +#include #endif #ifdef POWER_ENABLED diff --git a/sys/pic32/mem.c b/sys/pic32/mem.c index 68e1cfb..d511dcf 100644 --- a/sys/pic32/mem.c +++ b/sys/pic32/mem.c @@ -9,14 +9,6 @@ #include #include -const struct devspec mmdevs[] = { - { 0, "mem" }, - { 1, "kmem" }, - { 2, "null" }, - { 3, "zero" }, - { 0, 0 } -}; - void kmemdev() { u.u_rval = makedev(MEM_MAJOR, 1); diff --git a/sys/pic32/rd_mrams.c b/sys/pic32/mrams.c similarity index 98% rename from sys/pic32/rd_mrams.c rename to sys/pic32/mrams.c index 5dd1740..6dd80cc 100644 --- a/sys/pic32/rd_mrams.c +++ b/sys/pic32/mrams.c @@ -1,11 +1,15 @@ +/* + * TODO: Modify this driver to be able to function without rdisk layer. + */ #include #include #include #include #include -#include +#include #include #include +#include #define MRAM_WREN 0x06 #define MRAM_WRDI 0x04 diff --git a/sys/include/rd_mrams.h b/sys/pic32/mrams.h similarity index 100% rename from sys/include/rd_mrams.h rename to sys/pic32/mrams.h diff --git a/sys/pic32/picga.c b/sys/pic32/picga.c index 9414afd..0221a46 100644 --- a/sys/pic32/picga.c +++ b/sys/pic32/picga.c @@ -31,11 +31,6 @@ #include #include -const struct devspec picgadevs[] = { - { 0, "picga" }, - { 0, 0 } -}; - extern int uwritec(struct uio *); struct spiio picga_io; diff --git a/sys/pic32/pwm.c b/sys/pic32/pwm.c index f5840f2..cc69d79 100644 --- a/sys/pic32/pwm.c +++ b/sys/pic32/pwm.c @@ -2,6 +2,9 @@ * Pulse Width Modulation driver for PIC32. * Using Output Compare peripherals. * + * Devices: + * /dev/pwmX + * * Copyright (C) 2012 Majenko Technologies * * Permission to use, copy, modify, and distribute this software @@ -29,22 +32,9 @@ #include #include #include -#include +#include #include -/* - * Devices: - * /dev/pwmX - */ -const struct devspec pwmdevs[] = { - { 0, "pwm1" }, - { 1, "pwm2" }, - { 2, "pwm3" }, - { 3, "pwm4" }, - { 4, "pwm5" }, - { 0, 0 } -}; - #define _BC(R,B) (R &= ~(1< #include #include -#include #include #include @@ -135,12 +134,6 @@ int sd_timo_wait_widle; #define STOP_TRAN_TOKEN 0xFD /* stop token for write multiple */ #define WRITE_MULTIPLE_TOKEN 0xFC /* start data for write multiple */ -const struct devspec sddevs[] = { - { 0, "sd0" }, - { 1, "sd0a" }, { 2, "sd0b" }, { 3, "sd0c" }, { 4, "sd0d" }, - { 0, 0 } -}; - /* * Release the card's /CS signal. * Add extra clocks after a deselect. @@ -900,7 +893,7 @@ sd_probe(config) spi_set(io, PIC32_SPICON_CKE); #ifdef UCB_METER - dk_alloc(&sddrives[unit].dkindex, 1, sddevs[unit].devname); + dk_alloc(&sddrives[unit].dkindex, 1, (unit == 0) ? "sd0" : "sd1"); #endif return 1; } diff --git a/sys/pic32/sd.h b/sys/pic32/sd.h index 33174e3..d0b9d2e 100644 --- a/sys/pic32/sd.h +++ b/sys/pic32/sd.h @@ -7,8 +7,6 @@ extern int sdclose(dev_t dev, int flag, int mode); extern daddr_t sdsize(dev_t dev); extern void sdstrategy(register struct buf *bp); extern int sdioctl (dev_t dev, register u_int cmd, caddr_t addr, int flag); - -extern const struct devspec sddevs[]; #endif #endif diff --git a/sys/pic32/sdram.S b/sys/pic32/sdram.S index 93b4fb5..3f1e5c7 100644 --- a/sys/pic32/sdram.S +++ b/sys/pic32/sdram.S @@ -15,7 +15,7 @@ /* * See rd_sdramp_config.h for sdramp port/pin configuration */ -#include +#include /* Offsets (from TRISA) for the various port control registers */ #define TRIS_OFFSET 0x0 diff --git a/sys/pic32/rd_sdramp.c b/sys/pic32/sdramp.c similarity index 98% rename from sys/pic32/rd_sdramp.c rename to sys/pic32/sdramp.c index 281d62f..7f932b4 100644 --- a/sys/pic32/rd_sdramp.c +++ b/sys/pic32/sdramp.c @@ -1,5 +1,6 @@ /* * Driver for external SDRAM-based swap device. + * TODO: Modify this driver to be able to function without rdisk layer. * * See sdram.S for information on interface to sdram * @@ -11,14 +12,13 @@ #include #include #include -#include -#include +#include #include /* * See rd_sdramp_config.h for sdramp port/pin configuration */ -#include +#include int sw_dkn = -1; /* Statistics slot number */ diff --git a/sys/include/rd_sdramp.h b/sys/pic32/sdramp.h similarity index 100% rename from sys/include/rd_sdramp.h rename to sys/pic32/sdramp.h diff --git a/sys/pic32/rd_sdramp_config.h b/sys/pic32/sdramp_config.h similarity index 100% rename from sys/pic32/rd_sdramp_config.h rename to sys/pic32/sdramp_config.h diff --git a/sys/pic32/skel.c b/sys/pic32/skel.c index e5e3989..8c006d9 100644 --- a/sys/pic32/skel.c +++ b/sys/pic32/skel.c @@ -29,19 +29,6 @@ #include #include -/* - * List of device names and minor numbers. - * Assume we have five ports. - */ -const struct devspec skeldevs[] = { - { 0, "skel1" }, - { 1, "skel2" }, - { 2, "skel3" }, - { 3, "skel4" }, - { 4, "skel5" }, - { 0, 0 } -}; - #define NSKEL 5 /* Ports 1...5 */ /* diff --git a/sys/pic32/spi.c b/sys/pic32/spi.c index d56827b..a9ecd4a 100644 --- a/sys/pic32/spi.c +++ b/sys/pic32/spi.c @@ -30,14 +30,6 @@ #include #include -const struct devspec spidevs[] = { - { 0, "spi1" }, - { 1, "spi2" }, - { 2, "spi3" }, - { 3, "spi4" }, - { 0, 0 } -}; - #define NSPI 4 /* Ports SPI1...SPI4 */ /* diff --git a/sys/pic32/rd_spirams.c b/sys/pic32/spirams.c similarity index 99% rename from sys/pic32/rd_spirams.c rename to sys/pic32/spirams.c index 6e79cc1..fa04623 100644 --- a/sys/pic32/rd_spirams.c +++ b/sys/pic32/spirams.c @@ -1,11 +1,14 @@ +/* + * TODO: Modify this driver to be able to function without rdisk layer. + */ #include #include #include #include #include -#include #include #include +#include #define SPIRAM_WREN 0x06 #define SPIRAM_WRDI 0x04 diff --git a/sys/include/rd_spirams.h b/sys/pic32/spirams.h similarity index 100% rename from sys/include/rd_spirams.h rename to sys/pic32/spirams.h diff --git a/sys/pic32/rd_sramc.c b/sys/pic32/sramc.c similarity index 98% rename from sys/pic32/rd_sramc.c rename to sys/pic32/sramc.c index 56fb10a..2dbe5c1 100644 --- a/sys/pic32/rd_sramc.c +++ b/sys/pic32/sramc.c @@ -1,5 +1,6 @@ /* * Driver for external SRAM-CPLD based Swap and Filesystem devices + * TODO: Modify this driver to be able to function without rdisk layer. * * This version is for 8MB RAMDISK v.1.1 and compatible * Pito 7.4.2014 - PIC32MX PMP bus version @@ -21,8 +22,8 @@ #include #include #include -#include #include +#include int sw_dkn = -1; /* Statistics slot number */ diff --git a/sys/include/rd_sramc.h b/sys/pic32/sramc.h similarity index 100% rename from sys/include/rd_sramc.h rename to sys/pic32/sramc.h diff --git a/sys/pic32/swap.c b/sys/pic32/swap.c index 2271868..9ef42ec 100644 --- a/sys/pic32/swap.c +++ b/sys/pic32/swap.c @@ -18,9 +18,6 @@ #define NTMP 3 #endif -const struct devspec swapbdevs[] = { { 0, "swap0" }, { 1, "swap1" }, { 2, "swap2" }, { 64, "swap" }, { 0, 0 } }; -const struct devspec swapcdevs[] = { { 0, "temp0" }, { 1, "temp1" }, { 2, "temp2" }, { 0, 0 } }; - extern struct buf *getnewbuf(); static unsigned int tdsize[NTMP]; // Number of blocks allocated diff --git a/sys/pic32/uart.c b/sys/pic32/uart.c index dffc8c2..30e742e 100644 --- a/sys/pic32/uart.c +++ b/sys/pic32/uart.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #define CONCAT(x,y) x ## y #define BBAUD(x) CONCAT(B,x) @@ -83,16 +83,6 @@ static unsigned speed_bps [NSPEEDS] = { 2000000, 2500000, 3000000, 3500000, 4000000 }; -const struct devspec uartdevs[] = { - { 0, "tty0" }, - { 1, "tty1" }, - { 2, "tty2" }, - { 3, "tty3" }, - { 4, "tty4" }, - { 5, "tty5" }, - { 0, 0 }, -}; - void cnstart (struct tty *tp); /* diff --git a/sys/include/uart.h b/sys/pic32/uart.h similarity index 87% rename from sys/include/uart.h rename to sys/pic32/uart.h index b45adf9..ea97d0b 100644 --- a/sys/include/uart.h +++ b/sys/pic32/uart.h @@ -1,12 +1,9 @@ #ifndef _UART_H #define _UART_H -#include "tty.h" - #define NUART 6 #ifdef KERNEL -#include "conf.h" void uartinit(int unit); int uartopen(dev_t dev, int flag, int mode); @@ -21,7 +18,6 @@ void uartputc(dev_t dev, char c); char uartgetc(dev_t dev); extern struct tty uartttys[NUART]; -extern const struct devspec uartdevs[]; #endif diff --git a/sys/pic32/usb_uart.c b/sys/pic32/usb_uart.c index 259c7f9..fee968e 100644 --- a/sys/pic32/usb_uart.c +++ b/sys/pic32/usb_uart.c @@ -32,13 +32,6 @@ #include #include -unsigned int usb_major = 0; - -const struct devspec usbdevs[] = { - { 0, "ttyUSB0" }, - { 0, 0 } -}; - #define CONCAT(x,y) x ## y #define BBAUD(x) CONCAT(B,x) @@ -58,18 +51,13 @@ struct tty usbttys [1]; void usbstart (struct tty *tp); int usbopen (dev_t dev, int flag, int mode); + /* * Initialize USB module SFRs and firmware variables to known state. * Enable interrupts. */ void usbinit() { - int i; - for (i=0; i