Rename other disk drivers which needed rdisk.
Delete device names from all the drivers. Move device inslude files from include/sys to include/machine directory. Only include files which have something useful for user layer (like special ioctls codes) should be placed into sys.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/adc.h>
|
||||
#include <machine/adc.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int fd[16];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <sys/exec_aout.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/debug.h>
|
||||
|
||||
int exec_aout_check(struct exec_params *epp)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <sys/exec.h>
|
||||
#include <sys/dir.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/debug.h>
|
||||
|
||||
/*
|
||||
* How memory is set up.
|
||||
|
||||
@@ -18,13 +18,6 @@
|
||||
#endif
|
||||
#include <sys/syslog.h>
|
||||
|
||||
const struct devspec fddevs[] = {
|
||||
{ 0, "stdin" },
|
||||
{ 1, "stdout" },
|
||||
{ 2, "stderr" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
/*
|
||||
* Descriptor management.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/debug.h>
|
||||
|
||||
/*
|
||||
* exec system call, with and without environments.
|
||||
|
||||
@@ -17,11 +17,6 @@
|
||||
#include <sys/tty.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
const struct devspec sydevs[] = {
|
||||
{ 0, "tty" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
syopen (dev, flag)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <sys/vm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/debug.h>
|
||||
|
||||
#define MINFINITY -32767 /* minus infinity */
|
||||
|
||||
|
||||
@@ -27,18 +27,10 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/adc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/adc.h>
|
||||
#include <machine/debug.h>
|
||||
#include <sys/kconfig.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -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);
|
||||
@@ -11,14 +11,8 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <sys/uart.h>
|
||||
#include <sys/usb_uart.h>
|
||||
|
||||
const struct devspec cndevs[] = {
|
||||
{ 0, "console" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
#include <machine/uart.h>
|
||||
#include <machine/usb_uart.h>
|
||||
|
||||
dev_t console_device = -1;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/uart.h>
|
||||
#include <machine/uart.h>
|
||||
#include <sys/spi.h>
|
||||
#include <sys/gpio.h>
|
||||
|
||||
@@ -26,11 +26,23 @@ extern int strcmp(char *s1, char *s2);
|
||||
#ifdef SD_ENABLED
|
||||
# include <machine/sd.h>
|
||||
#endif
|
||||
#ifdef SRAMC_ENABLED
|
||||
# include <machine/sramc.h>
|
||||
#endif
|
||||
#ifdef SDRAMP_ENABLED
|
||||
# include <machine/sdramp.h>
|
||||
#endif
|
||||
#ifdef MRAMS_ENABLED
|
||||
# include <machine/mrams.h>
|
||||
#endif
|
||||
#ifdef SPIRAMS_ENABLED
|
||||
# include <machine/spirams.h>
|
||||
#endif
|
||||
#ifdef UARTUSB_ENABLED
|
||||
# include <sys/usb_uart.h>
|
||||
# include <machine/usb_uart.h>
|
||||
#endif
|
||||
#ifdef ADC_ENABLED
|
||||
# include <sys/adc.h>
|
||||
# include <machine/adc.h>
|
||||
#endif
|
||||
#ifdef GLCD_ENABLED
|
||||
# include <sys/glcd.h>
|
||||
@@ -45,7 +57,7 @@ extern int strcmp(char *s1, char *s2);
|
||||
# include <sys/pty.h>
|
||||
#endif
|
||||
#ifdef HXTFT_ENABLED
|
||||
# include <sys/hx8357.h>
|
||||
# include <machine/hx8357.h>
|
||||
#endif
|
||||
#ifdef SKEL_ENABLED
|
||||
# include <sys/skel.h>
|
||||
@@ -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
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/uart.h>
|
||||
#include <sys/usb_uart.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/tty.h>
|
||||
#include <machine/uart.h>
|
||||
#include <machine/usb_uart.h>
|
||||
|
||||
//#define TRACE_EXCEPTIONS
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,11 +31,6 @@
|
||||
#include <sys/debug.h>
|
||||
#include <sys/kconfig.h>
|
||||
|
||||
const struct devspec glcddevs[] = {
|
||||
{ 0, "glcd0" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
#define _BC(R,B) (R &= ~(1<<B))
|
||||
#define _BS(R,B) (R |= (1<<B))
|
||||
|
||||
|
||||
@@ -30,17 +30,6 @@
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kconfig.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/adc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/kconfig.h>
|
||||
#include <sys/hx8357.h>
|
||||
#include <machine/hx8357.h>
|
||||
#include <sys/fonts/default.h>
|
||||
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
@@ -19,17 +19,17 @@
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/kconfig.h>
|
||||
#include <sys/uart.h>
|
||||
#include <sys/usb_uart.h>
|
||||
#include <sys/tty.h>
|
||||
#include <machine/uart.h>
|
||||
#include <machine/usb_uart.h>
|
||||
#ifdef UARTUSB_ENABLED
|
||||
# include <machine/usb_device.h>
|
||||
# include <machine/usb_function_cdc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HX8357_ENABLED
|
||||
#include <sys/hx8357.h>
|
||||
#include <machine/hx8357.h>
|
||||
#endif
|
||||
|
||||
#ifdef POWER_ENABLED
|
||||
|
||||
@@ -9,14 +9,6 @@
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
const struct devspec mmdevs[] = {
|
||||
{ 0, "mem" },
|
||||
{ 1, "kmem" },
|
||||
{ 2, "null" },
|
||||
{ 3, "zero" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
void kmemdev()
|
||||
{
|
||||
u.u_rval = makedev(MEM_MAJOR, 1);
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
/*
|
||||
* TODO: Modify this driver to be able to function without rdisk layer.
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/spi.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/mrams.h>
|
||||
|
||||
#define MRAM_WREN 0x06
|
||||
#define MRAM_WRDI 0x04
|
||||
@@ -31,11 +31,6 @@
|
||||
#include <sys/spi.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
const struct devspec picgadevs[] = {
|
||||
{ 0, "picga" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
extern int uwritec(struct uio *);
|
||||
|
||||
struct spiio picga_io;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
* Pulse Width Modulation driver for PIC32.
|
||||
* Using Output Compare peripherals.
|
||||
*
|
||||
* Devices:
|
||||
* /dev/pwmX
|
||||
*
|
||||
* Copyright (C) 2012 Majenko Technologies <matt@majenko.co.uk>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
@@ -29,22 +32,9 @@
|
||||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/pwm.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/debug.h>
|
||||
#include <sys/kconfig.h>
|
||||
|
||||
/*
|
||||
* 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<<B))
|
||||
#define _BS(R,B) (R |= (1<<B))
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <sys/dk.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/spi.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/kconfig.h>
|
||||
#include <machine/sd.h>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*
|
||||
* See rd_sdramp_config.h for sdramp port/pin configuration
|
||||
*/
|
||||
#include <machine/rd_sdramp_config.h>
|
||||
#include <machine/sdramp_config.h>
|
||||
|
||||
/* Offsets (from TRISA) for the various port control registers */
|
||||
#define TRIS_OFFSET 0x0
|
||||
|
||||
@@ -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 <sys/errno.h>
|
||||
#include <sys/dk.h>
|
||||
#include <machine/sdram.h>
|
||||
#include <sys/rd_sdramp.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <machine/sdramp.h>
|
||||
#include <sys/kconfig.h>
|
||||
|
||||
/*
|
||||
* See rd_sdramp_config.h for sdramp port/pin configuration
|
||||
*/
|
||||
#include <machine/rd_sdramp_config.h>
|
||||
#include <machine/sdramp_config.h>
|
||||
|
||||
int sw_dkn = -1; /* Statistics slot number */
|
||||
|
||||
@@ -29,19 +29,6 @@
|
||||
#include <sys/uio.h>
|
||||
#include <sys/skel.h>
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
/*
|
||||
|
||||
@@ -30,14 +30,6 @@
|
||||
#include <sys/kconfig.h>
|
||||
#include <sys/spi.h>
|
||||
|
||||
const struct devspec spidevs[] = {
|
||||
{ 0, "spi1" },
|
||||
{ 1, "spi2" },
|
||||
{ 2, "spi3" },
|
||||
{ 3, "spi4" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
#define NSPI 4 /* Ports SPI1...SPI4 */
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/*
|
||||
* TODO: Modify this driver to be able to function without rdisk layer.
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <sys/spi.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/spirams.h>
|
||||
|
||||
#define SPIRAM_WREN 0x06
|
||||
#define SPIRAM_WRDI 0x04
|
||||
@@ -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 <sys/buf.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/dk.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <sys/debug.h>
|
||||
#include <machine/sramc.h>
|
||||
|
||||
int sw_dkn = -1; /* Statistics slot number */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <sys/tty.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kconfig.h>
|
||||
#include <sys/uart.h>
|
||||
#include <machine/uart.h>
|
||||
|
||||
#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);
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,13 +32,6 @@
|
||||
#include <machine/usb_device.h>
|
||||
#include <machine/usb_function_cdc.h>
|
||||
|
||||
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<nchrdev; i++) {
|
||||
if (cdevsw[i].d_open == usbopen) {
|
||||
usb_major = i;
|
||||
}
|
||||
}
|
||||
usb_device_init();
|
||||
IECSET(1) = 1 << (PIC32_IRQ_USB - 32);
|
||||
|
||||
@@ -289,7 +277,7 @@ static int
|
||||
usbprobe(config)
|
||||
struct conf_device *config;
|
||||
{
|
||||
int is_console = (CONS_MAJOR == usb_major);
|
||||
int is_console = (CONS_MAJOR == UARTUSB_MAJOR);
|
||||
|
||||
printf("uartusb: port USB, interrupt %u", PIC32_VECT_USB);
|
||||
if (is_console)
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
#ifndef _USB_UART_H
|
||||
#define _USB_UART_H
|
||||
|
||||
#include "conf.h"
|
||||
|
||||
extern const struct devspec usbdevs[];
|
||||
extern unsigned int usb_major;
|
||||
|
||||
#define USB_MAJOR 13
|
||||
|
||||
extern struct tty usbttys[1];
|
||||
Reference in New Issue
Block a user