diff --git a/sys/include/param.h b/sys/include/param.h index 5d57ebb..42d7940 100644 --- a/sys/include/param.h +++ b/sys/include/param.h @@ -51,7 +51,7 @@ /* * Signals */ -#include +#include #define NBPW sizeof(int) /* number of bytes in an integer */ @@ -111,7 +111,7 @@ #define MAXHOSTNAMELEN 64 #if defined(KERNEL) && defined(INET) -# include "machine/net_mac.h" +# include #endif /* diff --git a/sys/kernel/exec_aout.c b/sys/kernel/exec_aout.c index 68aa9d8..89cbff2 100644 --- a/sys/kernel/exec_aout.c +++ b/sys/kernel/exec_aout.c @@ -1,20 +1,20 @@ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "inode.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "namei.h" -#include "fs.h" -#include "mount.h" -#include "file.h" -#include "resource.h" -#include "exec.h" -#include "exec_aout.h" -#include "dir.h" -#include "uio.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int exec_aout_check(struct exec_params *epp) { diff --git a/sys/kernel/exec_conf.c b/sys/kernel/exec_conf.c index 002ca0a..01c7ff4 100644 --- a/sys/kernel/exec_conf.c +++ b/sys/kernel/exec_conf.c @@ -1,5 +1,3 @@ -/* $NetBSD: exec_conf.c,v 1.43 2000/06/09 22:38:57 oki Exp $ */ - /* * Copyright (c) 1993, 1994 Christopher G. Demetriou * All rights reserved. @@ -29,10 +27,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#include "param.h" -#include "inode.h" -#include "exec.h" +#include +#include +#include #ifdef EXEC_SCRIPT int exec_script_check(struct exec_params *epp); diff --git a/sys/kernel/exec_elf.c b/sys/kernel/exec_elf.c index 82062b0..e2d9c1c 100644 --- a/sys/kernel/exec_elf.c +++ b/sys/kernel/exec_elf.c @@ -1,5 +1,3 @@ -/* $NetBSD: exec_elf32.c,v 1.49.2.2 2000/11/03 20:00:38 tv Exp $ */ - /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. * All rights reserved. @@ -62,22 +60,20 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - -#include "param.h" -#include "systm.h" -#include "kernel.h" -#include "map.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "namei.h" -#include "exec.h" -#include "exec_elf.h" -#include "fcntl.h" -#include "signalvar.h" -#include "mount.h" -#include "stat.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include extern char sigcode[], esigcode[]; diff --git a/sys/kernel/exec_script.c b/sys/kernel/exec_script.c index fa04b86..315bee1 100644 --- a/sys/kernel/exec_script.c +++ b/sys/kernel/exec_script.c @@ -1,10 +1,10 @@ -#include "param.h" -#include "inode.h" -#include "dir.h" -#include "namei.h" -#include "exec.h" -#include "user.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include int exec_script_check(struct exec_params *epp) diff --git a/sys/kernel/exec_subr.c b/sys/kernel/exec_subr.c index 3f58560..3a5de8b 100644 --- a/sys/kernel/exec_subr.c +++ b/sys/kernel/exec_subr.c @@ -1,19 +1,19 @@ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "inode.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "namei.h" -#include "fs.h" -#include "mount.h" -#include "file.h" -#include "resource.h" -#include "exec.h" -#include "dir.h" -#include "uio.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * How memory is set up. diff --git a/sys/kernel/init_main.c b/sys/kernel/init_main.c index 593b49c..8251313 100644 --- a/sys/kernel/init_main.c +++ b/sys/kernel/init_main.c @@ -3,25 +3,25 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "fs.h" -#include "mount.h" -#include "map.h" -#include "proc.h" -#include "ioctl.h" -#include "inode.h" -#include "conf.h" -#include "buf.h" -#include "fcntl.h" -#include "vm.h" -#include "clist.h" -#include "reboot.h" -#include "systm.h" -#include "kernel.h" -#include "namei.h" -#include "stat.h" -#include "rdisk.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include u_int swapstart, nswap; /* start and size of swap space */ size_t physmem; /* total amount of physical memory */ @@ -150,8 +150,11 @@ main() s = spl0(); rdisk_init(); - pipedev = rootdev = get_boot_device(); - swapdev = get_swap_device(); + if (rootdev == NODEV) + rootdev = get_boot_device(); + if (swapdev == NODEV) + swapdev = get_swap_device(); + pipedev = rootdev; /* Mount a root filesystem. */ for (;;) { diff --git a/sys/kernel/init_sysent.c b/sys/kernel/init_sysent.c index ce46da4..1466335 100644 --- a/sys/kernel/init_sysent.c +++ b/sys/kernel/init_sysent.c @@ -5,9 +5,9 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "glob.h" +#include +#include +#include #ifdef INET # define ifnet(narg, name) narg, name diff --git a/sys/kernel/kern_clock.c b/sys/kernel/kern_clock.c index 1c93cb8..3b63959 100644 --- a/sys/kernel/kern_clock.c +++ b/sys/kernel/kern_clock.c @@ -3,13 +3,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "callout.h" -#include "dk.h" -#include "kernel.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include int noproc; /* no one is running just now */ diff --git a/sys/kernel/kern_descrip.c b/sys/kernel/kern_descrip.c index 6200ecc..c35e4a4 100644 --- a/sys/kernel/kern_descrip.c +++ b/sys/kernel/kern_descrip.c @@ -3,20 +3,20 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "file.h" -#include "systm.h" -#include "inode.h" -#include "ioctl.h" -#include "stat.h" -#include "conf.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef INET -#include "socket.h" -#include "socketvar.h" +#include +#include #endif -#include +#include const struct devspec fddevs[] = { { 0, "stdin" }, diff --git a/sys/kernel/kern_exec.c b/sys/kernel/kern_exec.c index 18f0162..6e25e5c 100644 --- a/sys/kernel/kern_exec.c +++ b/sys/kernel/kern_exec.c @@ -3,20 +3,20 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "inode.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "namei.h" -#include "fs.h" -#include "mount.h" -#include "file.h" -#include "signalvar.h" -#include "exec.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * exec system call, with and without environments. @@ -153,4 +153,3 @@ done: if (ip) iput(ip); } - diff --git a/sys/kernel/kern_exit.c b/sys/kernel/kern_exit.c index 2dbe097..9a10ff9 100644 --- a/sys/kernel/kern_exit.c +++ b/sys/kernel/kern_exit.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "vm.h" -#include "file.h" -#include "wait.h" -#include "kernel.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Notify parent that vfork child is finished with parent's data. Called diff --git a/sys/kernel/kern_fork.c b/sys/kernel/kern_fork.c index 656df03..f5e7d81 100644 --- a/sys/kernel/kern_fork.c +++ b/sys/kernel/kern_fork.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "file.h" -#include "vm.h" -#include "kernel.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int mpid; /* generic for unique process id's */ diff --git a/sys/kernel/kern_glob.c b/sys/kernel/kern_glob.c index 71b3e59..0054950 100644 --- a/sys/kernel/kern_glob.c +++ b/sys/kernel/kern_glob.c @@ -6,9 +6,9 @@ * byte = rdglob(addr); * success = wrglob(addr,byte); */ -#include "param.h" -#include "systm.h" -#include "user.h" +#include +#include +#include #ifndef GLOBSZ #define GLOBSZ 256 diff --git a/sys/kernel/kern_mman.c b/sys/kernel/kern_mman.c index 4705f05..b7f324d 100644 --- a/sys/kernel/kern_mman.c +++ b/sys/kernel/kern_mman.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "vm.h" -#include "systm.h" +#include +#include +#include +#include +#include void brk() diff --git a/sys/kernel/kern_proc.c b/sys/kernel/kern_proc.c index da4d820..4a302d6 100644 --- a/sys/kernel/kern_proc.c +++ b/sys/kernel/kern_proc.c @@ -3,10 +3,10 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "systm.h" +#include +#include +#include +#include /* * Is p an inferior of the current process? diff --git a/sys/kernel/kern_prot.c b/sys/kernel/kern_prot.c index 7b7306c..8666885 100644 --- a/sys/kernel/kern_prot.c +++ b/sys/kernel/kern_prot.c @@ -5,10 +5,10 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "systm.h" +#include +#include +#include +#include void getpid() diff --git a/sys/kernel/kern_prot2.c b/sys/kernel/kern_prot2.c index bbe5287..c184cb3 100644 --- a/sys/kernel/kern_prot2.c +++ b/sys/kernel/kern_prot2.c @@ -35,10 +35,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "systm.h" +#include +#include +#include +#include void setuid() diff --git a/sys/kernel/kern_resource.c b/sys/kernel/kern_resource.c index 707da9c..63bb3de 100644 --- a/sys/kernel/kern_resource.c +++ b/sys/kernel/kern_resource.c @@ -3,12 +3,12 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "systm.h" -#include "vm.h" -#include "kernel.h" +#include +#include +#include +#include +#include +#include /* * Resource controls and accounting. diff --git a/sys/kernel/kern_sig.c b/sys/kernel/kern_sig.c index 0d52cbd..02cbb63 100644 --- a/sys/kernel/kern_sig.c +++ b/sys/kernel/kern_sig.c @@ -3,13 +3,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "inode.h" -#include "proc.h" -#include "namei.h" -#include "signalvar.h" +#include +#include +#include +#include +#include +#include +#include /* * Can the current process send the signal `signum' to process `q'? diff --git a/sys/kernel/kern_subr.c b/sys/kernel/kern_subr.c index d1d88e5..9cb5d52 100644 --- a/sys/kernel/kern_subr.c +++ b/sys/kernel/kern_subr.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "buf.h" -#include "uio.h" +#include +#include +#include +#include +#include /* * Move data to/from user space. diff --git a/sys/kernel/kern_synch.c b/sys/kernel/kern_synch.c index f8d011f..2b35c1f 100644 --- a/sys/kernel/kern_synch.c +++ b/sys/kernel/kern_synch.c @@ -3,15 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "signal.h" -#include "signalvar.h" -#include "vm.h" -#include "kernel.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define SQSIZE 16 /* Must be power of 2 */ diff --git a/sys/kernel/kern_sysctl.c b/sys/kernel/kern_sysctl.c index a7a28b6..bdf7f77 100644 --- a/sys/kernel/kern_sysctl.c +++ b/sys/kernel/kern_sysctl.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include sysctlfn kern_sysctl; sysctlfn hw_sysctl; diff --git a/sys/kernel/kern_time.c b/sys/kernel/kern_time.c index f585529..4c488b1 100644 --- a/sys/kernel/kern_time.c +++ b/sys/kernel/kern_time.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "kernel.h" -#include "systm.h" +#include +#include +#include +#include +#include static void setthetime (tv) diff --git a/sys/kernel/rdisk.c b/sys/kernel/rdisk.c index 6631c10..cb79890 100644 --- a/sys/kernel/rdisk.c +++ b/sys/kernel/rdisk.c @@ -1,12 +1,12 @@ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "debug.h" -#include "ioctl.h" -#include "rdisk.h" -#include "conf.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define Q2(X) #X #define QUOTE(X) Q2((X)) diff --git a/sys/kernel/subr_log.c b/sys/kernel/subr_log.c index a45d936..ec4063b 100644 --- a/sys/kernel/subr_log.c +++ b/sys/kernel/subr_log.c @@ -19,18 +19,18 @@ #define NLOG 1 int nlog = 1; -#include "param.h" -#include "user.h" -#include "proc.h" -#include "ioctl.h" -#include "msgbuf.h" -#include "file.h" -#include "inode.h" -#include "errno.h" -#include "uio.h" -#include "map.h" -#include "systm.h" -#include "conf.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec logdevs[] = { { 0, "klog" }, diff --git a/sys/kernel/subr_prf.c b/sys/kernel/subr_prf.c index c7c3065..902d467 100644 --- a/sys/kernel/subr_prf.c +++ b/sys/kernel/subr_prf.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "buf.h" -#include "msgbuf.h" -#include "conf.h" -#include "ioctl.h" -#include "tty.h" -#include "reboot.h" -#include "systm.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define TOCONS 0x1 #define TOTTY 0x2 diff --git a/sys/kernel/subr_rmap.c b/sys/kernel/subr_rmap.c index 56eb615..66fddab 100644 --- a/sys/kernel/subr_rmap.c +++ b/sys/kernel/subr_rmap.c @@ -3,10 +3,10 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "map.h" -#include "vm.h" +#include +#include +#include +#include /* * Resource map handling routines. diff --git a/sys/kernel/sys_generic.c b/sys/kernel/sys_generic.c index c052fe5..6f88f2e 100644 --- a/sys/kernel/sys_generic.c +++ b/sys/kernel/sys_generic.c @@ -3,17 +3,17 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "signalvar.h" -#include "inode.h" -#include "file.h" -#include "ioctl.h" -#include "conf.h" -#include "uio.h" -#include "kernel.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int selwait; diff --git a/sys/kernel/sys_inode.c b/sys/kernel/sys_inode.c index 2ba579a..a285881 100644 --- a/sys/kernel/sys_inode.c +++ b/sys/kernel/sys_inode.c @@ -3,23 +3,23 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "signalvar.h" -#include "inode.h" -#include "buf.h" -#include "fs.h" -#include "file.h" -#include "stat.h" -#include "mount.h" -#include "conf.h" -#include "uio.h" -#include "ioctl.h" -#include "tty.h" -#include "kernel.h" -#include "systm.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include daddr_t rablock; /* block to be read ahead */ diff --git a/sys/kernel/sys_pipe.c b/sys/kernel/sys_pipe.c index bf3e5e0..7c380ba 100644 --- a/sys/kernel/sys_pipe.c +++ b/sys/kernel/sys_pipe.c @@ -3,15 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "file.h" -#include "fs.h" -#include "mount.h" -#include "uio.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include int readp (fp, uio, flag) diff --git a/sys/kernel/sys_process.c b/sys/kernel/sys_process.c index 1f9ecd8..66b49f3 100644 --- a/sys/kernel/sys_process.c +++ b/sys/kernel/sys_process.c @@ -3,13 +3,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "vm.h" -#include "ptrace.h" +#include +#include +#include +#include +#include +#include +#include /* * sys-trace system call. diff --git a/sys/kernel/tty.c b/sys/kernel/tty.c index 4933a94..a5fef87 100644 --- a/sys/kernel/tty.c +++ b/sys/kernel/tty.c @@ -3,19 +3,19 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "ioctl.h" -#include "tty.h" -#include "proc.h" -#include "file.h" -#include "conf.h" -#include "dk.h" -#include "uio.h" -#include "kernel.h" -#include "systm.h" -#include "inode.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static int rts = TIOCM_RTS; diff --git a/sys/kernel/tty_pty.c b/sys/kernel/tty_pty.c index 5a08a92..32cedc4 100644 --- a/sys/kernel/tty_pty.c +++ b/sys/kernel/tty_pty.c @@ -6,22 +6,22 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "pty.h" +#include #if NPTY > 0 -#include "param.h" -#include "systm.h" -#include "ioctl.h" -#include "tty.h" -#include "user.h" -#include "conf.h" -#include "file.h" -#include "proc.h" -#include "uio.h" -#include "kernel.h" -#include "inode.h" -#include "types.h" -#include "ttydev.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec ptsdevs[] = { { 0, "ttyp0" }, { 1, "ttyp1" }, { 2, "ttyp2" }, { 3, "ttyp3" }, diff --git a/sys/kernel/tty_subr.c b/sys/kernel/tty_subr.c index 9d3d4ea..0c785d7 100644 --- a/sys/kernel/tty_subr.c +++ b/sys/kernel/tty_subr.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "clist.h" -#include "ioctl.h" -#include "tty.h" -#include "systm.h" +#include +#include +#include +#include +#include char cwaiting; diff --git a/sys/kernel/tty_tty.c b/sys/kernel/tty_tty.c index 8a63d5d..63774a4 100644 --- a/sys/kernel/tty_tty.c +++ b/sys/kernel/tty_tty.c @@ -10,12 +10,12 @@ * Indirect driver for controlling tty. * */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "ioctl.h" -#include "tty.h" -#include "conf.h" +#include +#include +#include +#include +#include +#include const struct devspec sydevs[] = { { 0, "tty" }, diff --git a/sys/kernel/ufs_alloc.c b/sys/kernel/ufs_alloc.c index 2d78f67..8670241 100644 --- a/sys/kernel/ufs_alloc.c +++ b/sys/kernel/ufs_alloc.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "fs.h" -#include "dir.h" -#include "inode.h" -#include "buf.h" -#include "user.h" -#include "kernel.h" -#include "mount.h" -#include "proc.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include typedef struct fblk *FBLKP; diff --git a/sys/kernel/ufs_bio.c b/sys/kernel/ufs_bio.c index 5e4ce91..00d04bb 100644 --- a/sys/kernel/ufs_bio.c +++ b/sys/kernel/ufs_bio.c @@ -3,15 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "buf.h" -#include "user.h" -#include "conf.h" -#include "fs.h" -#include "dk.h" -#include "systm.h" -#include "map.h" -#include "proc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Read in (if necessary) the block and return a buffer pointer. diff --git a/sys/kernel/ufs_bmap.c b/sys/kernel/ufs_bmap.c index f768f37..54ce4ed 100644 --- a/sys/kernel/ufs_bmap.c +++ b/sys/kernel/ufs_bmap.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "conf.h" -#include "dir.h" -#include "inode.h" -#include "user.h" -#include "buf.h" -#include "fs.h" -#include "mount.h" -#include "uio.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Bmap defines the structure of file system storage diff --git a/sys/kernel/ufs_dsort.c b/sys/kernel/ufs_dsort.c index 4e8f9fc..f3e7a83 100644 --- a/sys/kernel/ufs_dsort.c +++ b/sys/kernel/ufs_dsort.c @@ -9,11 +9,10 @@ /* * generalized seek sort for disk */ - -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "dk.h" +#include +#include +#include +#include void disksort (dp, bp) diff --git a/sys/kernel/ufs_fio.c b/sys/kernel/ufs_fio.c index 8f7d33b..ea707db 100644 --- a/sys/kernel/ufs_fio.c +++ b/sys/kernel/ufs_fio.c @@ -3,14 +3,14 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "fs.h" -#include "inode.h" -#include "mount.h" -#include "namei.h" -#include "systm.h" -#include "stat.h" +#include +#include +#include +#include +#include +#include +#include +#include /* * Check mode permission on inode pointer. diff --git a/sys/kernel/ufs_inode.c b/sys/kernel/ufs_inode.c index 31bf5a0..860336c 100644 --- a/sys/kernel/ufs_inode.c +++ b/sys/kernel/ufs_inode.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "inode.h" -#include "fs.h" -#include "mount.h" -#include "kernel.h" -#include "buf.h" -#include "systm.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define INOHSZ 16 /* must be power of two */ #define INOHASH(dev,ino) (((dev)+(ino))&(INOHSZ-1)) diff --git a/sys/kernel/ufs_mount.c b/sys/kernel/ufs_mount.c index 0e2f91b..e934889 100644 --- a/sys/kernel/ufs_mount.c +++ b/sys/kernel/ufs_mount.c @@ -3,19 +3,19 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "inode.h" -#include "fs.h" -#include "buf.h" -#include "mount.h" -#include "file.h" -#include "namei.h" -#include "conf.h" -#include "stat.h" -#include "ioctl.h" -#include "proc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Common code for mount and umount. diff --git a/sys/kernel/ufs_namei.c b/sys/kernel/ufs_namei.c index 905a651..f86fe40 100644 --- a/sys/kernel/ufs_namei.c +++ b/sys/kernel/ufs_namei.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "inode.h" -#include "fs.h" -#include "mount.h" -#include "user.h" -#include "buf.h" -#include "namei.h" -#include "proc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int dirchk = 0; diff --git a/sys/kernel/ufs_subr.c b/sys/kernel/ufs_subr.c index bf4b889..38e4b19 100644 --- a/sys/kernel/ufs_subr.c +++ b/sys/kernel/ufs_subr.c @@ -3,15 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "fs.h" -#include "inode.h" -#include "buf.h" -#include "mount.h" -#include "kernel.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include int updlock; /* lock for sync */ diff --git a/sys/kernel/ufs_syscalls.c b/sys/kernel/ufs_syscalls.c index 85a425c..3ec55dc 100644 --- a/sys/kernel/ufs_syscalls.c +++ b/sys/kernel/ufs_syscalls.c @@ -3,16 +3,16 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "user.h" -#include "inode.h" -#include "namei.h" -#include "fs.h" -#include "file.h" -#include "stat.h" -#include "kernel.h" -#include "proc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Common routine for chroot and chdir. diff --git a/sys/kernel/ufs_syscalls2.c b/sys/kernel/ufs_syscalls2.c index f3dfed2..39bc460 100644 --- a/sys/kernel/ufs_syscalls2.c +++ b/sys/kernel/ufs_syscalls2.c @@ -2,17 +2,17 @@ * ufs_syscalls was getting too large. Various UFS related system calls were * relocated to this file. */ -#include "param.h" -#include "sys/file.h" -#include "user.h" -#include "inode.h" -#include "buf.h" -#include "fs.h" -#include "namei.h" -#include "mount.h" -#include "kernel.h" -#include "systm.h" -#include "proc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static int statfs1 (mp, sbp) diff --git a/sys/kernel/vfs_vnops.c b/sys/kernel/vfs_vnops.c index 98ecd3e..56080f3 100644 --- a/sys/kernel/vfs_vnops.c +++ b/sys/kernel/vfs_vnops.c @@ -41,8 +41,7 @@ #include #include #include - -#include "systm.h" +#include /* * 2.11BSD does not have "vnodes", having instead only old fashioned "inodes". diff --git a/sys/kernel/vm_sched.c b/sys/kernel/vm_sched.c index 8a9cb88..72aa3ee 100644 --- a/sys/kernel/vm_sched.c +++ b/sys/kernel/vm_sched.c @@ -3,13 +3,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "vm.h" -#include "kernel.h" -#include "systm.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include #define MINFINITY -32767 /* minus infinity */ diff --git a/sys/kernel/vm_swap.c b/sys/kernel/vm_swap.c index d89f5ae..588b011 100644 --- a/sys/kernel/vm_swap.c +++ b/sys/kernel/vm_swap.c @@ -3,13 +3,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "map.h" -#include "buf.h" -#include "systm.h" -#include "vm.h" +#include +#include +#include +#include +#include +#include +#include /* * Swap a process in. diff --git a/sys/kernel/vm_swp.c b/sys/kernel/vm_swp.c index 4af7dd3..34cc484 100644 --- a/sys/kernel/vm_swp.c +++ b/sys/kernel/vm_swp.c @@ -3,14 +3,14 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "conf.h" -#include "systm.h" -#include "vm.h" -#include "uio.h" +#include +#include +#include +#include +#include +#include +#include +#include /* * swap I/O diff --git a/sys/pic32/Config.generic b/sys/pic32/Config.generic index 38a02fa..bb6b9d3 100644 --- a/sys/pic32/Config.generic +++ b/sys/pic32/Config.generic @@ -9,11 +9,11 @@ # machine "pic32" -cpu "PIC32MX" +cpu "PIC32MX7" ident CHIPKIT_MAX # Linker script -ldscript "pic32/bootloader-max32.ld" +ldscript "cfg/bootloader-max32.ld" # Need to set locally timezone 8 dst @@ -23,11 +23,7 @@ maxusers 2 options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "HZ=100" # Rate of clock interrupt -#???options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -#???options "CRYSTAL=8" # PLL input frequency in MHz -#???options "CPU_IDIV=2" # PLL input divisor 1/2/3/4/5/6/10/12 -#???options "CPU_ODIV=1" # PLL output divisor 1/2/4/8/16/32/64/256 -#???options "CPU_MUL=20" # PLL multiplier 15/16/17/18/19/20/21/24 +options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 options "EXEC_AOUT" # Run a.out binaries options "EXEC_ELF" # Run ELF binaries options "EXEC_SCRIPT" # Run shell scripts @@ -66,8 +62,13 @@ device uart1 # Serial-to-USB converter device uart2 device uart3 device uart4 -options "UART_ENABLED" # TODO: delete this option +options "UART1_ENABLED" # TODO: delete this option +options "UART2_ENABLED" # TODO: delete this option +options "UART3_ENABLED" # TODO: delete this option +options "UART4_ENABLED" # TODO: delete this option options "UART1_BAUD=115200" # default speed +options "UART2_BAUD=115200" # default speed +options "UART3_BAUD=115200" # default speed options "UART4_BAUD=115200" # default speed options "UART4_ENA_PORT=TRISB" # to enable power for uart4... options "UART4_ENA_PIN=13" # ...use pin RB13 diff --git a/sys/pic32/Makefile.kconf b/sys/pic32/Makefile.kconf index b189b33..5ccb5c5 100644 --- a/sys/pic32/Makefile.kconf +++ b/sys/pic32/Makefile.kconf @@ -33,7 +33,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall CPP = ${MIPS_GCC_PREFIX}cpp LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL -LDFLAGS = -nostdlib -T $A/${LDSCRIPT} -Wl,-Map=unix.map +LDFLAGS = -nostdlib -T $S/pic32/${LDSCRIPT} -Wl,-Map=unix.map SIZE = ${MIPS_GCC_PREFIX}size OBJCOPY = ${MIPS_GCC_PREFIX}objcopy OBJDUMP = ${MIPS_GCC_PREFIX}objdump @@ -47,9 +47,8 @@ endif # source tree is located via $S relative to the compilation directory S = ../.. -A = $S/pic32 -COPTS = -I. -I$S/include ${IDENT} -DKERNEL +COPTS = -I. ${IDENT} -DKERNEL CFLAGS = -O ${COPTS} # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} @@ -65,8 +64,8 @@ DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< PROFILE_C = ${CC} -p -c ${COPTS} $< -NORMAL_S = ${CPP} ${COPTS} $< | ${AS} -o $@ -NORMAL_S_C = ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ +NORMAL_S = ${CC} -c ${COPTS} $< +NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $< %OBJS @@ -77,37 +76,43 @@ NORMAL_S_C = ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ # ${SYSTEM_LD_HEAD} # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} -SYSTEM_OBJ = startup.o ${OBJS} ioconf.o +SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o ifeq (devcfg.c,$(wildcard devcfg.c)) SYSTEM_OBJ += devcfg.o endif -SYSTEM_DEP = Makefile machine sys ${SYSTEM_OBJ} -SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh; ${CC} $(CFLAGS) -c vers.c; rm -f $@ +SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys ${SYSTEM_OBJ} +SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@ SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \ ${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf SYSTEM_LD_TAIL = ${SIZE} unix.elf; \ $(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \ + $(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \ $(OBJDUMP) -d -S unix.elf > unix.dis %LOAD clean: - rm -f *.elf *.o *.map *.dis + rm -f *.elf *.o *.map *.dis *.bin clean-all: clean - rm -f *.h *.c machine sys Makefile + rm -f *.h *.c machine sys -#startup.o: $A/pic32/startup.S $A/include/machAsmDefs.h \ -# $A/include/machConst.h $A/include/reg.h $A/include/assym.h -# ${CPP} ${COPTS} ${PARAM} -DLOCORE $A/pic32/startup.s | \ -# ${AS} -o startup.o +reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig + ../../../tools/kconfig/kconfig Config + $(MAKE) clean + +load: unix.elf + pic32prog unix.hex + +startup.o: $S/pic32/startup.S + ${NORMAL_S} # the following are necessary because the files depend on the types of # cpu's included in the system configuration clock.o machdep.o conf.o: Makefile machine: - ln -s $A $@ + ln -s $S/pic32 $@ sys: ln -s $S/include $@ diff --git a/sys/pic32/adc.c b/sys/pic32/adc.c index eb442e7..2a919a6 100644 --- a/sys/pic32/adc.c +++ b/sys/pic32/adc.c @@ -21,15 +21,14 @@ * arising out of or in connection with the use or performance of * this software. */ - -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "adc.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec adcdevs[] = { { 0, "adc0" }, { 1, "adc1" }, { 2, "adc2" }, { 3, "adc3" }, diff --git a/sys/pic32/clock.c b/sys/pic32/clock.c index 8f46aff..00ea1aa 100644 --- a/sys/pic32/clock.c +++ b/sys/pic32/clock.c @@ -3,8 +3,8 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "machine/pic32mx.h" +#include +#include /* * Setup core timer for `hz' timer interrupts per second. diff --git a/sys/pic32/cons.c b/sys/pic32/cons.c index 5734bc5..7573ac3 100644 --- a/sys/pic32/cons.c +++ b/sys/pic32/cons.c @@ -5,15 +5,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "tty.h" -#include "systm.h" +#include +#include +#include +#include +#include +#include -#include "uart.h" -#include "usb_uart.h" +#include +#include #define CONCAT(x,y) x ## y #define BBAUD(x) CONCAT(B,x) diff --git a/sys/pic32/devsw.c b/sys/pic32/devsw.c index 4f2c5a9..1cdb59d 100644 --- a/sys/pic32/devsw.c +++ b/sys/pic32/devsw.c @@ -3,54 +3,54 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "conf.h" -#include "buf.h" -#include "time.h" -#include "ioctl.h" -#include "resource.h" -#include "inode.h" -#include "proc.h" -#include "clist.h" -#include "tty.h" -#include "systm.h" -#include "rdisk.h" -#include "errno.h" -#include "uart.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "swap.h" +#include extern int strcmp(char *s1, char *s2); #ifdef UARTUSB_ENABLED -# include "usb_uart.h" +# include #endif #ifdef GPIO_ENABLED -# include "gpio.h" +# include #endif #ifdef ADC_ENABLED -# include "adc.h" +# include #endif #ifdef SPI_ENABLED -# include "spi.h" +# include #endif #ifdef GLCD_ENABLED -# include "glcd.h" +# include #endif #ifdef PWM_ENABLED -# include "pwm.h" +# include #endif #ifdef PICGA_ENABLED -# include "picga.h" +# include #endif #ifdef PTY_ENABLED -# include "pty.h" +# include #endif #ifdef HX8357_ENABLED -# include "hx8357.h" +# include #endif #ifdef SKEL_ENABLED -# include "skel.h" +# include #endif /* diff --git a/sys/pic32/exception.c b/sys/pic32/exception.c index c7dbd45..4f2c3d3 100644 --- a/sys/pic32/exception.c +++ b/sys/pic32/exception.c @@ -3,15 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "signalvar.h" -#include "systm.h" -#include "user.h" -#include "proc.h" -#include "vm.h" -#include "uart.h" -#include "usb_uart.h" -#include "debug.h" +#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 4b25a7e..dff2eb4 100644 --- a/sys/pic32/files.kconf +++ b/sys/pic32/files.kconf @@ -71,7 +71,6 @@ pic32/signal.c standard pic32/skel.c optional skel pic32/spi.c optional spi pic32/spi_bus.c optional spi -pic32/startup.S standard pic32/swap.c standard pic32/sysctl.c standard pic32/uart.c optional uart diff --git a/sys/pic32/glcd.c b/sys/pic32/glcd.c index a27d6dc..7adcb34 100644 --- a/sys/pic32/glcd.c +++ b/sys/pic32/glcd.c @@ -21,14 +21,14 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "sys/uio.h" -#include "glcd.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec glcddevs[] = { { 0, "glcd0" }, diff --git a/sys/pic32/gpio.c b/sys/pic32/gpio.c index a6d474a..0937fe9 100644 --- a/sys/pic32/gpio.c +++ b/sys/pic32/gpio.c @@ -21,13 +21,13 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "gpio.h" -#include "systm.h" -#include "uio.h" +#include +#include +#include +#include +#include +#include +#include const struct devspec gpiodevs[] = { { 0, "porta" }, { 1, "portb" }, { 2, "portc" }, { 3, "portd" }, diff --git a/sys/pic32/hx8357.c b/sys/pic32/hx8357.c index f827ff1..e496326 100644 --- a/sys/pic32/hx8357.c +++ b/sys/pic32/hx8357.c @@ -21,17 +21,16 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "adc.h" -#include "debug.h" -#include "hx8357.h" - -#include "fonts/default.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include char frame[40][80]; diff --git a/sys/pic32/machdep.c b/sys/pic32/machdep.c index 18d0125..9e54a15 100644 --- a/sys/pic32/machdep.c +++ b/sys/pic32/machdep.c @@ -3,32 +3,32 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "dir.h" -#include "inode.h" -#include "user.h" -#include "proc.h" -#include "fs.h" -#include "map.h" -#include "buf.h" -#include "file.h" -#include "clist.h" -#include "callout.h" -#include "reboot.h" -#include "msgbuf.h" -#include "namei.h" -#include "mount.h" -#include "systm.h" -#include "debug.h" -#include "uart.h" -#include "usb_uart.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef UARTUSB_ENABLED # include # include #endif #ifdef HX8357_ENABLED -#include "hx8357.h" +#include #endif #ifdef POWER_ENABLED @@ -147,9 +147,15 @@ nodump(dev) int (*dump)(dev_t) = nodump; -dev_t rootdev, swapdev, pipedev; - +#ifdef CONFIG +/* + * Build using old configuration utility (configsys). + */ +dev_t rootdev = NODEV; +dev_t swapdev = NODEV; dev_t dumpdev = NODEV; +#endif +dev_t pipedev; daddr_t dumplo = (daddr_t) 1024; /* diff --git a/sys/pic32/max32/.gitignore b/sys/pic32/max32/.gitignore index 6a22af6..7e25ca8 100644 --- a/sys/pic32/max32/.gitignore +++ b/sys/pic32/max32/.gitignore @@ -7,3 +7,6 @@ unix.bin unix.map usbboot.map vers.c +*.h +ioconf.c +swapunix.c diff --git a/sys/pic32/max32/Config b/sys/pic32/max32/Config index 80e6333..6c0dd06 100644 --- a/sys/pic32/max32/Config +++ b/sys/pic32/max32/Config @@ -9,43 +9,30 @@ # machine "pic32" -cpu "PIC32MX" +cpu "PIC32MX7" ident CHIPKIT_MAX # Linker script -ldscript "pic32/bootloader-max32.ld" +ldscript "cfg/bootloader-max32.ld" # Need to set locally timezone 8 dst maxusers 2 # Standard system options +#options "CONFIG=MAX32" # TODO options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "HZ=100" # Rate of clock interrupt -#???options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -#???options "CRYSTAL=8" # PLL input frequency in MHz -#???options "CPU_IDIV=2" # PLL input divisor 1/2/3/4/5/6/10/12 -#???options "CPU_ODIV=1" # PLL output divisor 1/2/4/8/16/32/64/256 -#???options "CPU_MUL=20" # PLL multiplier 15/16/17/18/19/20/21/24 +options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 options "EXEC_AOUT" # Run a.out binaries options "EXEC_ELF" # Run ELF binaries options "EXEC_SCRIPT" # Run shell scripts options "UCB_METER" # Collect kernel statistics -# LEDs -#options "LED_DISK_PORT=TRISF" # for disk activity LED... -#options "LED_DISK_PIN=0" # ...use pin RF0 -#options "LED_DISK_INVERT" # invert disk LED -#options "LED_SWAP_PORT=TRISF" # for swap activity LED... -#options "LED_SWAP_PIN=1" # ...use pin RF1 -#options "LED_SWAP_INVERT" # invert swap LED -#options "LED_TTY_PORT=TRISA" # for tty LED... -#options "LED_TTY_PIN=2" # ...use pin RA2 -#options "LED_TTY_INVERT" # invert tty LED -#options "LED_KERNEL_PORT=TRISA" # for kernel actibity LED... -#options "LED_KERNEL_PIN=3" # ...use pin RA3 -#options "LED_KERNEL_INVERT" # invert kernel LED +# LED +options "LED_KERNEL_PORT=TRISA" # for kernel actibity LED... +options "LED_KERNEL_PIN=3" # ...use pin RA3 # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -57,7 +44,10 @@ device uart1 # Serial-to-USB converter device uart2 device uart3 device uart4 -options "UART_ENABLED" # TODO: delete this option +options "UART1_ENABLED" # TODO: delete this option +options "UART2_ENABLED" # TODO: delete this option +options "UART3_ENABLED" # TODO: delete this option +options "UART4_ENABLED" # TODO: delete this option # Console options options "CONSOLE_DEVICE=tty0" # /dev/tty0 @@ -88,5 +78,5 @@ device pwm0 options "PWM_ENABLED" # TODO: delete this option # Skeleton driver -device skel0 -options "SKEL_ENABLED" # TODO: delete this option +#device skel0 +#options "SKEL_ENABLED" # TODO: delete this option diff --git a/sys/pic32/max32/Makefile b/sys/pic32/max32/Makefile index d5d74e8..b139e4d 100644 --- a/sys/pic32/max32/Makefile +++ b/sys/pic32/max32/Makefile @@ -1,51 +1,367 @@ -BUILDPATH = ../../../tools/configsys/../../sys/pic32 -H = ../../../tools/configsys/../../sys/include -M = ../../../tools/configsys/../../sys/pic32 -S = ../../../tools/configsys/../../sys/kernel +IDENT=-DCHIPKIT_MAX -DPIC32MX7 -DPWM_ENABLED -DADC_ENABLED -DGPIO_ENABLED -DSD0_CS_PIN=14 -DSD0_CS_PORT=TRISC -DSD0_PORT=2 -DSD0_MHZ=10 -DSPI_ENABLED -DCONSOLE_DEVICE=tty0 -DUART4_ENABLED -DUART3_ENABLED -DUART2_ENABLED -DUART1_ENABLED -DLED_KERNEL_PIN=3 -DLED_KERNEL_PORT=TRISA -DUCB_METER -DEXEC_SCRIPT -DEXEC_ELF -DEXEC_AOUT -DBUS_DIV=1 -DHZ=100 -DBUS_KHZ=80000 -DCPU_KHZ=80000 +LDSCRIPT="cfg/bootloader-max32.ld" +PARAM=-DTIMEZONE=480 -DDST=1 -DMAXUSERS=2 +# +# Makefile for RetroBSD, pic32 target +# +# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g). +# PROF is set to -pg by kconfig if profiling is requested (kconfig -p). -vpath %.c $(M):$(S) -vpath %.S $(M):$(S) +ifndef MIPS_GCC_ROOT + ifeq (/usr/local/mips-2014.05,$(wildcard /usr/local/mips-2014.05)) + MIPS_GCC_ROOT = /usr/local/mips-2014.05 + endif + ifeq (/usr/local/mips-gcc-4.8.1,$(wildcard /usr/local/mips-gcc-4.8.1)) + MIPS_GCC_ROOT = /usr/local/mips-gcc-4.8.1 + endif + ifeq (/usr/local/pic32-tools,$(wildcard /usr/local/pic32-tools)) + MIPS_GCC_ROOT = /usr/local/pic32-tools + endif + ifdef UECIDE + MIPS_GCC_ROOT = ${UECIDE}/compilers/pic32-tools + endif +endif -KERNOBJ += adc.o clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o pwm.o rd_sd.o rdisk.o signal.o spi.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o -EXTRA_TARGETS = +ifeq (${MIPS_GCC_ROOT}/bin/mips-sde-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-sde-elf-gcc)) + MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/mips-sde-elf- +endif +ifeq (${MIPS_GCC_ROOT}/bin/mips-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-elf-gcc)) + MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/mips-elf- +endif +ifeq (${MIPS_GCC_ROOT}/bin/pic32-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/pic32-gcc)) + MIPS_GCC_PREFIX ?= ${MIPS_GCC_ROOT}/bin/pic32- +endif -DEFS += -DADC_ENABLED=YES -DEFS += -DBUS_DIV=1 -DEFS += -DBUS_KHZ=80000 -DEFS += -DCONSOLE_DEVICE=tty0 -DEFS += -DCPU_IDIV=2 -DEFS += -DCPU_KHZ=80000 -DEFS += -DCPU_MUL=20 -DEFS += -DCPU_ODIV=1 -DEFS += -DCRYSTAL=8 -DEFS += -DEXEC_AOUT -DEFS += -DEXEC_ELF -DEFS += -DEXEC_SCRIPT -DEFS += -DGPIO_ENABLED=YES -DEFS += -DKERNEL -DEFS += -DLED_KERNEL_PIN=3 -DEFS += -DLED_KERNEL_PORT=TRISA -DEFS += -DPIC32MX7 -DEFS += -DPWM_ENABLED=YES -DEFS += -DSD0_CS_PIN=14 -DEFS += -DSD0_CS_PORT=TRISC -DEFS += -DSD0_MHZ=10 -DEFS += -DSD0_PORT=2 -DEFS += -DSPI_ENABLED=YES -DEFS += -DUART1_BAUD=115200 -DEFS += -DUART1_ENABLED=YES -DEFS += -DUART2_BAUD=115200 -DEFS += -DUART2_ENABLED=YES -DEFS += -DUART3_BAUD=115200 -DEFS += -DUART3_ENABLED=YES -DEFS += -DUART4_BAUD=115200 -DEFS += -DUART4_ENABLED=YES -DEFS += -DUCB_METER +AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL +CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall +CPP = ${MIPS_GCC_PREFIX}cpp +LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL +LDFLAGS = -nostdlib -T $S/pic32/${LDSCRIPT} -Wl,-Map=unix.map +SIZE = ${MIPS_GCC_PREFIX}size +OBJCOPY = ${MIPS_GCC_PREFIX}objcopy +OBJDUMP = ${MIPS_GCC_PREFIX}objdump +ifeq (${MIPS_GCC_ROOT}/bin/mips-elf-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/mips-elf-gcc)) + LDFLAGS += -Wl,--oformat=elf32-littlemips +endif +ifeq (${MIPS_GCC_ROOT}/bin/pic32-gcc,$(wildcard ${MIPS_GCC_ROOT}/bin/pic32-gcc)) + LDFLAGS += -Wl,--oformat=elf32-tradlittlemips +endif -LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-max32.ld +# source tree is located via $S relative to the compilation directory +S = ../.. -CONFIG = MAX32 -CONFIGPATH = ../../../tools/configsys +COPTS = -I. ${IDENT} -DKERNEL +CFLAGS = -O ${COPTS} + +# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} +# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, +# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file +# is marked as config-dependent. + +NORMAL_C = ${CC} -c ${CFLAGS} ${PROF} $< +NORMAL_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< + +DRIVER_C = ${CC} -c ${CFLAGS} ${PROF} $< +DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< + +PROFILE_C = ${CC} -p -c ${COPTS} $< + +NORMAL_S = ${CC} -c ${COPTS} $< +NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $< + +OBJS=exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \ + init_main.o init_sysent.o kern_clock.o kern_descrip.o \ + kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \ + kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \ + kern_subr.o kern_synch.o kern_sysctl.o kern_time.o rdisk.o \ + subr_prf.o subr_rmap.o sys_generic.o sys_inode.o sys_pipe.o \ + sys_process.o syscalls.o tty.o tty_subr.o tty_tty.o ufs_alloc.o \ + ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o \ + ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o \ + ufs_syscalls2.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o adc.o \ + clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \ + rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o uart.o + +CFILES=$S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \ + $S/kernel/exec_script.c $S/kernel/exec_subr.c \ + $S/kernel/init_main.c $S/kernel/init_sysent.c \ + $S/kernel/kern_clock.c $S/kernel/kern_descrip.c \ + $S/kernel/kern_exec.c $S/kernel/kern_exit.c \ + $S/kernel/kern_fork.c $S/kernel/kern_mman.c \ + $S/kernel/kern_proc.c $S/kernel/kern_prot.c \ + $S/kernel/kern_prot2.c $S/kernel/kern_resource.c \ + $S/kernel/kern_sig.c $S/kernel/kern_sig2.c $S/kernel/kern_subr.c \ + $S/kernel/kern_synch.c $S/kernel/kern_sysctl.c \ + $S/kernel/kern_time.c $S/kernel/rdisk.c $S/kernel/subr_prf.c \ + $S/kernel/subr_rmap.c $S/kernel/sys_generic.c \ + $S/kernel/sys_inode.c $S/kernel/sys_pipe.c \ + $S/kernel/sys_process.c $S/kernel/syscalls.c $S/kernel/tty.c \ + $S/kernel/tty_subr.c $S/kernel/tty_tty.c $S/kernel/ufs_alloc.c \ + $S/kernel/ufs_bio.c $S/kernel/ufs_bmap.c $S/kernel/ufs_dsort.c \ + $S/kernel/ufs_fio.c $S/kernel/ufs_inode.c $S/kernel/ufs_mount.c \ + $S/kernel/ufs_namei.c $S/kernel/ufs_subr.c \ + $S/kernel/ufs_syscalls.c $S/kernel/ufs_syscalls2.c \ + $S/kernel/vfs_vnops.c $S/kernel/vm_sched.c $S/kernel/vm_swap.c \ + $S/kernel/vm_swp.c $S/pic32/adc.c $S/pic32/clock.c \ + $S/pic32/cons.c $S/pic32/devsw.c $S/pic32/exception.c \ + $S/pic32/gpio.c $S/pic32/machdep.c $S/pic32/mem.c $S/pic32/pwm.c \ + $S/pic32/rd_sd.c $S/pic32/signal.c $S/pic32/spi.c \ + $S/pic32/spi_bus.c $S/pic32/swap.c $S/pic32/sysctl.c \ + $S/pic32/uart.c swapunix.c + +# load lines for config "xxx" will be emitted as: +# xxx: ${SYSTEM_DEP} swapxxx.o +# ${SYSTEM_LD_HEAD} +# ${SYSTEM_LD} swapxxx.o +# ${SYSTEM_LD_TAIL} +SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o +ifeq (devcfg.c,$(wildcard devcfg.c)) + SYSTEM_OBJ += devcfg.o +endif +SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys ${SYSTEM_OBJ} +SYSTEM_LD_HEAD = sh $S/pic32/newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@ +SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \ + ${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf +SYSTEM_LD_TAIL = ${SIZE} unix.elf; \ + $(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \ + $(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \ + $(OBJDUMP) -d -S unix.elf > unix.dis + +unix.elf: ${SYSTEM_DEP} swapunix.o + ${SYSTEM_LD_HEAD} + ${SYSTEM_LD} swapunix.o + ${SYSTEM_LD_TAIL} + +swapunix.o: swapunix.c + ${NORMAL_C} + +all: unix.elf + +clean: + rm -f *.elf *.o *.map *.dis *.bin + +clean-all: clean + rm -f *.h *.c machine sys + +reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig + ../../../tools/kconfig/kconfig Config + $(MAKE) clean + +load: unix.elf + pic32prog unix.hex + +startup.o: $S/pic32/startup.S + ${NORMAL_S} + +# the following are necessary because the files depend on the types of +# cpu's included in the system configuration +clock.o machdep.o conf.o: Makefile + +machine: + ln -s $S/pic32 $@ + +sys: + ln -s $S/include $@ + +depend: machine + mkdep ${COPTS} ${CFILES} ioconf.c + +ioconf.o: ioconf.c + ${CC} -c ${CFLAGS} ioconf.c + +exec_aout.o: $S/kernel/exec_aout.c + ${NORMAL_C} + +exec_conf.o: $S/kernel/exec_conf.c + ${NORMAL_C} + +exec_elf.o: $S/kernel/exec_elf.c + ${NORMAL_C} + +exec_script.o: $S/kernel/exec_script.c + ${NORMAL_C} + +exec_subr.o: $S/kernel/exec_subr.c + ${NORMAL_C} + +init_main.o: $S/kernel/init_main.c + ${NORMAL_C} + +init_sysent.o: $S/kernel/init_sysent.c + ${NORMAL_C} + +kern_clock.o: $S/kernel/kern_clock.c + ${NORMAL_C} + +kern_descrip.o: $S/kernel/kern_descrip.c + ${NORMAL_C} + +kern_exec.o: $S/kernel/kern_exec.c + ${NORMAL_C} + +kern_exit.o: $S/kernel/kern_exit.c + ${NORMAL_C} + +kern_fork.o: $S/kernel/kern_fork.c + ${NORMAL_C} + +kern_mman.o: $S/kernel/kern_mman.c + ${NORMAL_C} + +kern_proc.o: $S/kernel/kern_proc.c + ${NORMAL_C} + +kern_prot.o: $S/kernel/kern_prot.c + ${NORMAL_C} + +kern_prot2.o: $S/kernel/kern_prot2.c + ${NORMAL_C} + +kern_resource.o: $S/kernel/kern_resource.c + ${NORMAL_C} + +kern_sig.o: $S/kernel/kern_sig.c + ${NORMAL_C} + +kern_sig2.o: $S/kernel/kern_sig2.c + ${NORMAL_C} + +kern_subr.o: $S/kernel/kern_subr.c + ${NORMAL_C} + +kern_synch.o: $S/kernel/kern_synch.c + ${NORMAL_C} + +kern_sysctl.o: $S/kernel/kern_sysctl.c + ${NORMAL_C} + +kern_time.o: $S/kernel/kern_time.c + ${NORMAL_C} + +rdisk.o: $S/kernel/rdisk.c + ${NORMAL_C} + +subr_prf.o: $S/kernel/subr_prf.c + ${NORMAL_C} + +subr_rmap.o: $S/kernel/subr_rmap.c + ${NORMAL_C} + +sys_generic.o: $S/kernel/sys_generic.c + ${NORMAL_C} + +sys_inode.o: $S/kernel/sys_inode.c + ${NORMAL_C} + +sys_pipe.o: $S/kernel/sys_pipe.c + ${NORMAL_C} + +sys_process.o: $S/kernel/sys_process.c + ${NORMAL_C} + +syscalls.o: $S/kernel/syscalls.c + ${NORMAL_C} + +tty.o: $S/kernel/tty.c + ${NORMAL_C} + +tty_subr.o: $S/kernel/tty_subr.c + ${NORMAL_C} + +tty_tty.o: $S/kernel/tty_tty.c + ${NORMAL_C} + +ufs_alloc.o: $S/kernel/ufs_alloc.c + ${NORMAL_C} + +ufs_bio.o: $S/kernel/ufs_bio.c + ${NORMAL_C} + +ufs_bmap.o: $S/kernel/ufs_bmap.c + ${NORMAL_C} + +ufs_dsort.o: $S/kernel/ufs_dsort.c + ${NORMAL_C} + +ufs_fio.o: $S/kernel/ufs_fio.c + ${NORMAL_C} + +ufs_inode.o: $S/kernel/ufs_inode.c + ${NORMAL_C} + +ufs_mount.o: $S/kernel/ufs_mount.c + ${NORMAL_C} + +ufs_namei.o: $S/kernel/ufs_namei.c + ${NORMAL_C} + +ufs_subr.o: $S/kernel/ufs_subr.c + ${NORMAL_C} + +ufs_syscalls.o: $S/kernel/ufs_syscalls.c + ${NORMAL_C} + +ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c + ${NORMAL_C} + +vfs_vnops.o: $S/kernel/vfs_vnops.c + ${NORMAL_C} + +vm_sched.o: $S/kernel/vm_sched.c + ${NORMAL_C} + +vm_swap.o: $S/kernel/vm_swap.c + ${NORMAL_C} + +vm_swp.o: $S/kernel/vm_swp.c + ${NORMAL_C} + +adc.o: $S/pic32/adc.c + ${NORMAL_C} + +clock.o: $S/pic32/clock.c + ${NORMAL_C} + +cons.o: $S/pic32/cons.c + ${NORMAL_C} + +devsw.o: $S/pic32/devsw.c + ${NORMAL_C} + +exception.o: $S/pic32/exception.c + ${NORMAL_C} + +gpio.o: $S/pic32/gpio.c + ${NORMAL_C} + +machdep.o: $S/pic32/machdep.c + ${NORMAL_C} + +mem.o: $S/pic32/mem.c + ${NORMAL_C} + +pwm.o: $S/pic32/pwm.c + ${NORMAL_C} + +rd_sd.o: $S/pic32/rd_sd.c + ${NORMAL_C} + +signal.o: $S/pic32/signal.c + ${NORMAL_C} + +spi.o: $S/pic32/spi.c + ${NORMAL_C} + +spi_bus.o: $S/pic32/spi_bus.c + ${NORMAL_C} + +swap.o: $S/pic32/swap.c + ${NORMAL_C} + +sysctl.o: $S/pic32/sysctl.c + ${NORMAL_C} + +uart.o: $S/pic32/uart.c + ${NORMAL_C} -include ../../../tools/configsys/../../sys/pic32/kernel-post.mk diff --git a/sys/pic32/mem.c b/sys/pic32/mem.c index e8e9301..bf406a0 100644 --- a/sys/pic32/mem.c +++ b/sys/pic32/mem.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "conf.h" -#include "systm.h" -#include "uio.h" +#include +#include +#include +#include +#include const struct devspec mmdevs[] = { { 0, "mem" }, diff --git a/sys/pic32/picga.c b/sys/pic32/picga.c index c6aec3f..8aaf924 100644 --- a/sys/pic32/picga.c +++ b/sys/pic32/picga.c @@ -21,16 +21,15 @@ * arising out of or in connection with the use or performance of * this software. */ - -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "picga.h" -#include "spi_bus.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec picgadevs[] = { { 0, "picga" }, @@ -45,7 +44,7 @@ void blockdelay(unsigned int v) { for( ; v>0 ; v--) asm volatile ("nop"); -} +} void picga_command(unsigned char cmd, unsigned char len, void *data) { diff --git a/sys/pic32/power_control.c b/sys/pic32/power_control.c index 2a379c5..bfb3d37 100644 --- a/sys/pic32/power_control.c +++ b/sys/pic32/power_control.c @@ -1,9 +1,9 @@ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "systm.h" -#include "machparam.h" -#include "reboot.h" +#include +#include +#include +#include +#include +#include volatile unsigned int psCounter; int countdown; diff --git a/sys/pic32/pwm.c b/sys/pic32/pwm.c index e52206c..792bbdc 100644 --- a/sys/pic32/pwm.c +++ b/sys/pic32/pwm.c @@ -22,14 +22,14 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "sys/uio.h" -#include "pwm.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include /* * Devices: diff --git a/sys/pic32/rd_flash.c b/sys/pic32/rd_flash.c index 51ec7fa..d3eef65 100644 --- a/sys/pic32/rd_flash.c +++ b/sys/pic32/rd_flash.c @@ -1,9 +1,9 @@ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "debug.h" +#include +#include +#include +#include +#include +#include extern unsigned char flash_data[] asm("_binary_flash_img_start"); extern unsigned char flash_data_size[] asm("_binary_flash_img_size"); diff --git a/sys/pic32/rd_mrams.c b/sys/pic32/rd_mrams.c index 92bf16e..6446e7d 100644 --- a/sys/pic32/rd_mrams.c +++ b/sys/pic32/rd_mrams.c @@ -1,12 +1,11 @@ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "rdisk.h" -#include "spi_bus.h" - -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include #define MRAM_WREN 0x06 #define MRAM_WRDI 0x04 diff --git a/sys/pic32/rd_sd.c b/sys/pic32/rd_sd.c index 8cd84f2..6da12ce 100644 --- a/sys/pic32/rd_sd.c +++ b/sys/pic32/rd_sd.c @@ -29,15 +29,14 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "rdisk.h" -#include "spi_bus.h" - -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include /* * Two SD/MMC disks on SPI. diff --git a/sys/pic32/rd_sdramp.c b/sys/pic32/rd_sdramp.c index 8640dbc..203e8a1 100644 --- a/sys/pic32/rd_sdramp.c +++ b/sys/pic32/rd_sdramp.c @@ -5,20 +5,19 @@ * * This code could use a bit of optimization. */ - -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "sdram.h" -#include "rd_sdramp.h" -#include "rdisk.h" +#include +#include +#include +#include +#include +#include +#include +#include /* * See rd_sdramp_config.h for sdramp port/pin configuration */ -#include "rd_sdramp_config.h" +#include int sw_dkn = -1; /* Statistics slot number */ diff --git a/sys/pic32/rd_spirams.c b/sys/pic32/rd_spirams.c index eb6bdd7..0fd3277 100644 --- a/sys/pic32/rd_spirams.c +++ b/sys/pic32/rd_spirams.c @@ -1,12 +1,11 @@ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "rdisk.h" -#include "spi_bus.h" - -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include #define SPIRAM_WREN 0x06 #define SPIRAM_WRDI 0x04 diff --git a/sys/pic32/rd_sramc.c b/sys/pic32/rd_sramc.c index 08cadd5..56fb10a 100644 --- a/sys/pic32/rd_sramc.c +++ b/sys/pic32/rd_sramc.c @@ -16,14 +16,13 @@ * Signals PMRD, PMWR are active LOW and idle HIGH * Signal PMA0 is LOW when accessing RAM Data, and HIGH when accessing RAM Addresses */ -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "rdisk.h" - -#include "debug.h" +#include +#include +#include +#include +#include +#include +#include int sw_dkn = -1; /* Statistics slot number */ diff --git a/sys/pic32/sdram.S b/sys/pic32/sdram.S index 47b86cb..93b4fb5 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 "rd_sdramp_config.h" +#include /* Offsets (from TRISA) for the various port control registers */ #define TRIS_OFFSET 0x0 diff --git a/sys/pic32/signal.c b/sys/pic32/signal.c index c25e170..1a97819 100644 --- a/sys/pic32/signal.c +++ b/sys/pic32/signal.c @@ -3,14 +3,14 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "systm.h" -#include "signalvar.h" -#include "user.h" -#include "proc.h" -#include "buf.h" -#include "map.h" -#include "syslog.h" +#include +#include +#include +#include +#include +#include +#include +#include //#define DIAGNOSTIC diff --git a/sys/pic32/skel.c b/sys/pic32/skel.c index 015085e..e5e3989 100644 --- a/sys/pic32/skel.c +++ b/sys/pic32/skel.c @@ -21,13 +21,13 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "skel.h" +#include +#include +#include +#include +#include +#include +#include /* * List of device names and minor numbers. diff --git a/sys/pic32/spi.c b/sys/pic32/spi.c index fe4ca18..5cc83a2 100644 --- a/sys/pic32/spi.c +++ b/sys/pic32/spi.c @@ -21,14 +21,14 @@ * arising out of or in connection with the use or performance of * this software. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "spi.h" -#include "spi_bus.h" +#include +#include +#include +#include +#include +#include +#include +#include const struct devspec spidevs[] = { { 0, "spi1" }, diff --git a/sys/pic32/spi_bus.c b/sys/pic32/spi_bus.c index 814d836..0431b6d 100644 --- a/sys/pic32/spi_bus.c +++ b/sys/pic32/spi_bus.c @@ -1,10 +1,10 @@ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "systm.h" -#include "uio.h" -#include "spi_bus.h" +#include +#include +#include +#include +#include +#include +#include #define NSPI 4 /* Ports SPI1...SPI4 */ diff --git a/sys/pic32/ssd1926-sdcard.c b/sys/pic32/ssd1926-sdcard.c index 3bc2260..a3424c1 100644 --- a/sys/pic32/ssd1926-sdcard.c +++ b/sys/pic32/ssd1926-sdcard.c @@ -28,7 +28,7 @@ * Sean Justice 15_Sept-2008 First release * Anton Alkhimenok 06_Jun-2009 Ported to PIC24 */ -#include "ssd1926.h" +#include /* * Helper Macros diff --git a/sys/pic32/startup.S b/sys/pic32/startup.S index 6e3599a..fcbe9b2 100644 --- a/sys/pic32/startup.S +++ b/sys/pic32/startup.S @@ -22,7 +22,7 @@ # arising out of or in connection with the use or performance of # this software. # -#include "machine/io.h" +#include #define UBASE 0x7f008000 /* User space base address */ diff --git a/sys/pic32/swap.c b/sys/pic32/swap.c index 1feb0fa..36b01ac 100644 --- a/sys/pic32/swap.c +++ b/sys/pic32/swap.c @@ -2,18 +2,17 @@ * Simple proxy for swap partition. Forwards requests for /dev/swap on to the * device specified by swapdev */ - -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "errno.h" -#include "dk.h" -#include "uio.h" -#include "conf.h" -#include "fcntl.h" -#include "map.h" -#include "swap.h" -#include "rdisk.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef NTMP #define NTMP 3 diff --git a/sys/pic32/sysctl.c b/sys/pic32/sysctl.c index 230e762..aa1bbd2 100644 --- a/sys/pic32/sysctl.c +++ b/sys/pic32/sysctl.c @@ -3,24 +3,24 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "user.h" -#include "ioctl.h" -#include "proc.h" -#include "kernel.h" -#include "file.h" -#include "inode.h" -#include "sysctl.h" -#include "cpu.h" -#include "tty.h" -#include "systm.h" -#include "dk.h" -#include "vmsystm.h" -#include "ptrace.h" -#include "namei.h" -#include "vmmeter.h" -#include "map.h" -#include "conf.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Errno messages. diff --git a/sys/pic32/uart.c b/sys/pic32/uart.c index 7539d70..c4d5a22 100644 --- a/sys/pic32/uart.c +++ b/sys/pic32/uart.c @@ -5,13 +5,13 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -#include "param.h" -#include "conf.h" -#include "user.h" -#include "ioctl.h" -#include "tty.h" -#include "systm.h" -#include "uart.h" +#include +#include +#include +#include +#include +#include +#include #define CONCAT(x,y) x ## y #define BBAUD(x) CONCAT(B,x) diff --git a/tools/kconfig/main.c b/tools/kconfig/main.c index ee5d6c5..f599672 100644 --- a/tools/kconfig/main.c +++ b/tools/kconfig/main.c @@ -92,7 +92,6 @@ usage: fputs("usage: kconfig [-gp] sysname\n", stderr); makefile(); /* build Makefile */ headers(); /* make a lot of .h files */ swapconf(); /* swap config files */ - printf("Don't forget to run \"make depend\"\n"); exit(0); } diff --git a/tools/kconfig/mkswapconf.c b/tools/kconfig/mkswapconf.c index e680528..abe3231 100644 --- a/tools/kconfig/mkswapconf.c +++ b/tools/kconfig/mkswapconf.c @@ -93,6 +93,13 @@ do_swap(fl) fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\t/* %s */\n", major(fl->f_dumpdev), minor(fl->f_dumpdev), devtoname(fl->f_dumpdev)); +#if 1 + /* Only one swap device is supported. */ + dev = swap->f_swapdev; + fprintf(fp, "dev_t\tswapdev = makedev(%d, %d);\t/* %s */\n", + major(swap->f_swapdev), minor(swap->f_swapdev), + devtoname(swap->f_swapdev)); +#else fprintf(fp, "\n"); fprintf(fp, "struct\tswdevt swdevt[] = {\n"); do { @@ -104,6 +111,7 @@ do_swap(fl) } while (swap && swap->f_type == SWAPSPEC); fprintf(fp, "\t{ NODEV, 0, 0 }\n"); fprintf(fp, "};\n"); +#endif fclose(fp); return (swap); }