diff options
Diffstat (limited to 'sys/kern')
33 files changed, 228 insertions, 115 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 7cfebf0..aabe534 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: imgact_elf.c,v 1.23 1998/03/28 13:24:52 bde Exp $ + * $Id: imgact_elf.c,v 1.24 1998/04/28 18:15:07 eivind Exp $ */ #include "opt_rlimit.h" @@ -60,10 +60,27 @@ #define MAX_PHDR 32 /* XXX enough ? */ -static int elf_check_header __P((const Elf32_Ehdr *hdr, int type)); +#if ELF_TARG_CLASS == ELFCLASS32 + +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Phdr Elf32_Phdr +#define Elf_Auxargs Elf32_Auxargs +#define Elf_Brandinfo Elf32_Brandinfo + +#else + +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Phdr Elf64_Phdr +#define Elf_Auxargs Elf64_Auxargs +#define Elf_Brandinfo Elf64_Brandinfo + +#endif + + +static int elf_check_header __P((const Elf_Ehdr *hdr, int type)); static int elf_load_section __P((struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)); static int elf_load_file __P((struct proc *p, char *file, u_long *addr, u_long *entry)); -static int elf_freebsd_fixup __P((int **stack_base, struct image_params *imgp)); +static int elf_freebsd_fixup __P((long **stack_base, struct image_params *imgp)); static int exec_elf_imgact __P((struct image_params *imgp)); static int elf_trace = 0; @@ -87,20 +104,20 @@ static struct sysentvec elf_freebsd_sysvec = { "FreeBSD ELF" }; -static Elf32_Brandinfo freebsd_brand_info = { +static Elf_Brandinfo freebsd_brand_info = { "FreeBSD", "", "/usr/libexec/ld-elf.so.1", &elf_freebsd_sysvec }; -static Elf32_Brandinfo *elf_brand_list[MAX_BRANDS] = { +static Elf_Brandinfo *elf_brand_list[MAX_BRANDS] = { &freebsd_brand_info, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int -elf_insert_brand_entry(Elf32_Brandinfo *entry) +elf_insert_brand_entry(Elf_Brandinfo *entry) { int i; @@ -116,7 +133,7 @@ elf_insert_brand_entry(Elf32_Brandinfo *entry) } int -elf_remove_brand_entry(Elf32_Brandinfo *entry) +elf_remove_brand_entry(Elf_Brandinfo *entry) { int i; @@ -132,7 +149,7 @@ elf_remove_brand_entry(Elf32_Brandinfo *entry) } static int -elf_check_header(const Elf32_Ehdr *hdr, int type) +elf_check_header(const Elf_Ehdr *hdr, int type) { if (!(hdr->e_ident[EI_MAG0] == ELFMAG0 && hdr->e_ident[EI_MAG1] == ELFMAG1 && @@ -140,9 +157,15 @@ elf_check_header(const Elf32_Ehdr *hdr, int type) hdr->e_ident[EI_MAG3] == ELFMAG3)) return ENOEXEC; +#ifdef __i396__ if (hdr->e_machine != EM_386 && hdr->e_machine != EM_486) +#endif +#ifdef __alpha__ + if (hdr->e_machine != EM_ALPHA) +#endif return ENOEXEC; + if (hdr->e_type != type) return ENOEXEC; @@ -222,8 +245,8 @@ elf_load_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, static int elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry) { - Elf32_Ehdr *hdr = NULL; - Elf32_Phdr *phdr = NULL; + Elf_Ehdr *hdr = NULL; + Elf_Phdr *phdr = NULL; struct nameidata nd; struct vmspace *vmspace = p->p_vmspace; struct vattr attr; @@ -273,7 +296,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry) if (error) goto fail; - hdr = (Elf32_Ehdr *)imgp->image_header; + hdr = (Elf_Ehdr *)imgp->image_header; if (error = elf_check_header(hdr, ET_DYN)) goto fail; @@ -294,7 +317,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry) goto fail; } - phdr = (Elf32_Phdr *)(imgp->image_header + hdr->e_phoff); + phdr = (Elf_Phdr *)(imgp->image_header + hdr->e_phoff); for (i = 0; i < hdr->e_phnum; i++) { switch(phdr[i].p_type) { @@ -380,9 +403,9 @@ fail: static int exec_elf_imgact(struct image_params *imgp) { - const Elf32_Ehdr *hdr = (const Elf32_Ehdr *) imgp->image_header; - const Elf32_Phdr *phdr, *mapped_phdr = NULL; - Elf32_Auxargs *elf_auxargs = NULL; + const Elf_Ehdr *hdr = (const Elf_Ehdr *) imgp->image_header; + const Elf_Phdr *phdr, *mapped_phdr = NULL; + Elf_Auxargs *elf_auxargs = NULL; struct vmspace *vmspace; vm_prot_t prot = 0; u_long text_size = 0, data_size = 0; @@ -419,7 +442,7 @@ exec_elf_imgact(struct image_params *imgp) /* Only support headers in first page for now */ return ENOEXEC; } else { - phdr = (const Elf32_Phdr*) + phdr = (const Elf_Phdr*) ((const char *)imgp->image_header + hdr->e_phoff); } @@ -514,7 +537,7 @@ exec_elf_imgact(struct image_params *imgp) vmspace->vm_dsize = data_size >> PAGE_SHIFT; vmspace->vm_daddr = (caddr_t)data_addr; - addr = 2*MAXDSIZ; /* May depend on OS type XXX */ + addr = 2L*MAXDSIZ; /* May depend on OS type XXX */ imgp->entry_addr = entry; @@ -564,8 +587,13 @@ exec_elf_imgact(struct image_params *imgp) } if (i == MAX_BRANDS) { uprintf("ELF binary type not known\n"); +#ifdef __alpha__ + uprintf("assuming FreeBSD\n"); + i = 0; +#else error = ENOEXEC; goto fail; +#endif } if (interp) { if (error = elf_load_file(imgp->proc, @@ -582,7 +610,7 @@ exec_elf_imgact(struct image_params *imgp) /* * Construct auxargs table (used by the fixup routine) */ - elf_auxargs = malloc(sizeof(Elf32_Auxargs), M_TEMP, M_WAITOK); + elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK); elf_auxargs->execfd = -1; elf_auxargs->phdr = proghdr; elf_auxargs->phent = hdr->e_phentsize; @@ -604,10 +632,10 @@ fail: } static int -elf_freebsd_fixup(int **stack_base, struct image_params *imgp) +elf_freebsd_fixup(long **stack_base, struct image_params *imgp) { - Elf32_Auxargs *args = (Elf32_Auxargs *)imgp->auxargs; - int *pos; + Elf_Auxargs *args = (Elf_Auxargs *)imgp->auxargs; + long *pos; pos = *stack_base + (imgp->argc + imgp->envc + 2); @@ -630,7 +658,7 @@ elf_freebsd_fixup(int **stack_base, struct image_params *imgp) imgp->auxargs = NULL; (*stack_base)--; - **stack_base = (int)imgp->argc; + **stack_base = (long)imgp->argc; return 0; } diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ea599a7..ff5a0c5 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.92 1998/05/17 11:52:35 phk Exp $ + * $Id: init_main.c,v 1.93 1998/05/28 09:30:15 phk Exp $ */ #include "opt_devfs.h" @@ -390,6 +390,7 @@ proc0_init(dummy) vmspace0.vm_map.pmap = &vmspace0.vm_pmap; p->p_addr = proc0paddr; /* XXX */ +#ifndef __alpha__ /* XXX what is this? */ #define INCOMPAT_LITES2 #ifdef INCOMPAT_LITES2 /* @@ -397,6 +398,7 @@ proc0_init(dummy) */ cpu_set_init_frame(p, init_framep); /* XXX! */ #endif /* INCOMPAT_LITES2*/ +#endif /* * We continue to place resource usage info and signal @@ -603,10 +605,10 @@ start_init(p) /* * Move out the arg pointers. */ - uap = (char **)((int)ucp & ~(NBPW-1)); + uap = (char **)((long)ucp & ~(NBPW-1)); (void)suword((caddr_t)--uap, 0); /* terminator */ - (void)suword((caddr_t)--uap, (int)arg1); - (void)suword((caddr_t)--uap, (int)arg0); + (void)suword((caddr_t)--uap, (long)arg1); + (void)suword((caddr_t)--uap, (long)arg0); /* * Point at the arguments. diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index e66ebe1..912c4c5 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -30,11 +30,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_conf.c,v 1.22 1997/09/27 13:39:03 kato Exp $ + * $Id: kern_conf.c,v 1.23 1997/11/22 08:35:37 bde Exp $ */ #include <sys/param.h> #include <sys/systm.h> +#include <sys/module.h> #include <sys/conf.h> #include <sys/vnode.h> @@ -212,3 +213,64 @@ bdevsw_add_generic(int bdev, int cdev, struct bdevsw *bdevsw) dev = makedev(bdev, 0); bdevsw_add(&dev, bdevsw , NULL); } + +int +cdevsw_module_handler(module_t mod, modeventtype_t what, void* arg) +{ + struct cdevsw_module_data* data = (struct cdevsw_module_data*) arg; + int error; + + switch (what) { + case MOD_LOAD: + if (error = cdevsw_add(&data->dev, data->cdevsw, NULL)) + return error; + break; + + case MOD_UNLOAD: + if (error = cdevsw_add(&data->dev, NULL, NULL)) + return error; + break; + } + + if (data->chainevh) + return data->chainevh(mod, what, data->chainarg); + else + return 0; +} + +int +bdevsw_module_handler(module_t mod, modeventtype_t what, void* arg) +{ + struct bdevsw_module_data* data = (struct bdevsw_module_data*) arg; + int error; + + switch (what) { + case MOD_LOAD: + /* + * XXX hack alert. + */ + if (isdisk(data->bdev, VBLK) && data->bdevsw->d_flags != D_DISK) { + printf("bdevsw_module_handler: adding D_DISK flag for device %d\n", + major(data->bdev)); + data->bdevsw->d_flags = D_DISK; + } + cdevsw_make(data->bdevsw); + if (error = cdevsw_add(&data->cdev, data->bdevsw->d_cdev, NULL)) + return error; + if (error = bdevsw_add(&data->bdev, data->bdevsw, NULL)) + return error; + break; + + case MOD_UNLOAD: + if (error = cdevsw_add(&data->cdev, NULL, NULL)) + return error; + if (error = cdevsw_add(&data->bdev, NULL, NULL)) + return error; + break; + } + + if (data->chainevh) + return data->chainevh(mod, what, data->chainarg); + else + return 0; +} diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 04e0f1a..aaeb50b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.81 1998/03/08 06:21:33 dyson Exp $ + * $Id: kern_exec.c,v 1.82 1998/04/17 22:36:50 des Exp $ */ #include <sys/param.h> @@ -63,7 +63,7 @@ #include <machine/reg.h> -static int *exec_copyout_strings __P((struct image_params *)); +static long *exec_copyout_strings __P((struct image_params *)); /* * XXX trouble here if sizeof(caddr_t) != sizeof(int), other parts @@ -99,7 +99,7 @@ execve(p, uap) register struct execve_args *uap; { struct nameidata nd, *ndp; - int *stack_base; + long *stack_base; int error, len, i; struct image_params image_params, *imgp; struct vattr attr; @@ -388,8 +388,10 @@ exec_map_first_page(imgp) ma[0] = vm_page_lookup(object, 0); if ((rv != VM_PAGER_OK) || (ma[0] == NULL) || (ma[0]->valid == 0)) { - vm_page_protect(ma[0], VM_PROT_NONE); - vm_page_free(ma[0]); + if (ma[0]) { + vm_page_protect(ma[0], VM_PROT_NONE); + vm_page_free(ma[0]); + } splx(s); return EIO; } @@ -473,7 +475,8 @@ exec_extract_strings(imgp) { char **argv, **envv; char *argp, *envp; - int error, length; + int error; + size_t length; /* * extract arguments first @@ -536,14 +539,14 @@ exec_extract_strings(imgp) * new arg and env vector tables. Return a pointer to the base * so that it can be used as the initial stack pointer. */ -int * +long * exec_copyout_strings(imgp) struct image_params *imgp; { int argc, envc; char **vectp; char *stringp, *destp; - int *stack_base; + long *stack_base; struct ps_strings *arginfo; int szsigcode; @@ -586,7 +589,7 @@ exec_copyout_strings(imgp) /* * vectp also becomes our initial stack base */ - stack_base = (int *)vectp; + stack_base = (long *)vectp; stringp = imgp->stringbase; argc = imgp->argc; @@ -600,14 +603,14 @@ exec_copyout_strings(imgp) /* * Fill in "ps_strings" struct for ps, w, etc. */ - suword(&arginfo->ps_argvstr, (int)vectp); + suword(&arginfo->ps_argvstr, (long)vectp); suword(&arginfo->ps_nargvstr, argc); /* * Fill in argument portion of vector table. */ for (; argc > 0; --argc) { - suword(vectp++, (int)destp); + suword(vectp++, (long)destp); while (*stringp++ != 0) destp++; destp++; @@ -616,14 +619,14 @@ exec_copyout_strings(imgp) /* a null vector table pointer seperates the argp's from the envp's */ suword(vectp++, 0); - suword(&arginfo->ps_envstr, (int)vectp); + suword(&arginfo->ps_envstr, (long)vectp); suword(&arginfo->ps_nenvstr, envc); /* * Fill in environment portion of vector table. */ for (; envc > 0; --envc) { - suword(vectp++, (int)destp); + suword(vectp++, (long)destp); while (*stringp++ != 0) destp++; destp++; diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 384a2d2..5d927e0 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: kern_intr.c,v 1.13 1998/02/10 17:10:23 eivind Exp $ + * $Id: kern_intr.c,v 1.14 1998/04/17 04:53:39 bde Exp $ * */ @@ -78,7 +78,7 @@ intr_mux(void *arg) while (p != NULL) { int oldspl = splq(p->mask); /* inthand2_t should take (void*) argument */ - p->handler((int)p->argument); + p->handler((long)p->argument); splx(oldspl); p = p->next; } @@ -189,7 +189,7 @@ add_intrdesc(intrec *idesc) idesc->maskptr, idesc->flags) != 0) return (-1); - update_intrname(irq, (int)idesc->devdata); + update_intrname(irq, (long)idesc->devdata); /* keep reference */ intreclist_head[irq] = idesc; } else { @@ -318,7 +318,7 @@ intr_disconnect(intrec *idesc) head->argument, head->maskptr, head->flags); if (errcode == 0) - update_intrname(irq, (int)head->devdata); + update_intrname(irq, (long)head->devdata); } } splx(oldspl); @@ -410,8 +410,8 @@ register_intr(int intr, int device_id, u_int flags, intrec *idesc; flags |= INTR_EXCL; - idesc = intr_create((void *)device_id, intr, handler, - (void*)unit, maskptr, flags); + idesc = intr_create((void *)(long)device_id, intr, handler, + (void*)(long)unit, maskptr, flags); return (intr_connect(idesc)); } diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index 02e7d5e..e384fd9 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_lkm.c,v 1.47 1998/02/11 20:47:55 dima Exp $ + * $Id: kern_lkm.c,v 1.48 1998/02/12 18:02:07 eivind Exp $ */ #include "opt_devfs.h" @@ -190,7 +190,7 @@ lkmcclose(dev, flag, mode, p) static int lkmcioctl(dev, cmd, data, flag, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flag; struct proc *p; @@ -315,7 +315,7 @@ lkmcioctl(dev, cmd, data, flag, p) /* XXX gack */ curp->entry = (int (*) __P((struct lkm_table *, int, int))) - (*((int *)data)); + (*((long *)data)); /* call entry(load)... (assigns "private" portion) */ err = (*(curp->entry))(curp, LKM_E_LOAD, LKM_VERSION); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index e48c1ad..e65453f 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_shutdown.c,v 1.31 1998/05/12 17:34:02 bde Exp $ + * $Id: kern_shutdown.c,v 1.32 1998/05/17 22:12:13 tegge Exp $ */ #include "opt_ddb.h" @@ -278,7 +278,9 @@ boot(howto) if (howto & RB_DUMP) { if (!cold) { savectx(&dumppcb); +#ifdef __i386__ dumppcb.pcb_cr3 = rcr3(); +#endif dumpsys(); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d7f4dc3..9026fb2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 - * $Id: kern_sig.c,v 1.39 1998/02/06 12:13:24 eivind Exp $ + * $Id: kern_sig.c,v 1.40 1998/03/03 20:55:26 tegge Exp $ */ #include "opt_compat.h" @@ -1028,7 +1028,7 @@ issignal(p) * Return the signal's number, or fall through * to clear it from the pending mask. */ - switch ((int)p->p_sigacts->ps_sigact[signum]) { + switch ((int)(long)p->p_sigacts->ps_sigact[signum]) { case (int)SIG_DFL: /* diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 1f2f28b..a225192 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_subr.c,v 1.18 1998/02/05 03:32:07 dyson Exp $ + * $Id: kern_subr.c,v 1.19 1998/02/06 12:13:25 eivind Exp $ */ #include <sys/param.h> @@ -143,9 +143,9 @@ uiomoveco(cp, n, uio, obj) case UIO_USERISPACE: if (uio->uio_rw == UIO_READ) { if (vfs_ioopt && ((cnt & PAGE_MASK) == 0) && - ((((int) iov->iov_base) & PAGE_MASK) == 0) && + ((((long) iov->iov_base) & PAGE_MASK) == 0) && ((uio->uio_offset & PAGE_MASK) == 0) && - ((((int) cp) & PAGE_MASK) == 0)) { + ((((long) cp) & PAGE_MASK) == 0)) { error = vm_uiomove(&curproc->p_vmspace->vm_map, obj, uio->uio_offset, cnt, (vm_offset_t) iov->iov_base, NULL); @@ -208,7 +208,7 @@ uioread(n, uio, obj, nread) cnt = n; if ((uio->uio_segflg == UIO_USERSPACE) && - ((((int) iov->iov_base) & PAGE_MASK) == 0) && + ((((long) iov->iov_base) & PAGE_MASK) == 0) && ((uio->uio_offset & PAGE_MASK) == 0) ) { if (cnt < PAGE_SIZE) diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c index 58c403b..5afe7c9 100644 --- a/sys/kern/link_aout.c +++ b/sys/kern/link_aout.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: link_aout.c,v 1.4 1997/11/07 08:52:59 phk Exp $ + * $Id: link_aout.c,v 1.5 1997/11/20 20:07:50 bde Exp $ */ #include <sys/param.h> @@ -38,6 +38,8 @@ #include <a.out.h> #include <link.h> +#ifndef __alpha__ + static int link_aout_load_file(const char*, linker_file_t*); static int link_aout_lookup_symbol(linker_file_t, const char*, @@ -443,3 +445,6 @@ restart: return 0; } + +#endif /* !__alpha__ */ + diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 9f5339b..43a8562 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,6 +1,6 @@ #! /bin/sh - # @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93 -# $Id: makesyscalls.sh,v 1.30 1998/02/03 17:39:13 bde Exp $ +# $Id: makesyscalls.sh,v 1.31 1998/03/09 04:00:42 jb Exp $ set -e @@ -37,7 +37,7 @@ case $# in ;; esac -if [ -f $2 ]; then +if [ -n "$2" -a -f "$2" ]; then . $2 fi @@ -112,6 +112,8 @@ s/\$//g printf "#define\t%s\n\n", sysproto_h > sysarg printf "#include <sys/signal.h>\n\n" > sysarg printf "struct proc;\n\n" > sysarg + printf "#define PAD_(t) sizeof(register_t) <= sizeof(t) ? \\\n" > sysarg + printf "\t\t0 : sizeof(register_t) - sizeof(t)\n\n" > sysarg printf " * created from%s\n */\n\n", $0 > sysnames printf "char *%s[] = {\n", namesname > sysnames @@ -257,12 +259,13 @@ s/\$//g if (argc != 0 && $2 != "NOARGS" && $2 != "NOPROTO") { printf("struct\t%s {\n", argalias) > sysarg for (i = 1; i <= argc; i++) - printf("\t%s %s;\n", argtype[i], - argname[i]) > sysarg + printf("\t%s %s;\tchar %s_[PAD_(%s)];\n", + argtype[i], argname[i], + argname[i], argtype[i]) > sysarg printf("};\n") > sysarg } else if($2 != "NOARGS" && $2 != "NOPROTO") - printf("struct\t%s {\n\tint dummy;\n};\n", \ + printf("struct\t%s {\n\tregister_t dummy;\n};\n", \ argalias) > sysarg } if ($2 != "NOPROTO" && (!nosys || funcname != "nosys") && \ @@ -307,12 +310,13 @@ s/\$//g if (argc != 0 && $2 != "CPT_NOA") { printf("struct\t%s {\n", argalias) > syscompat for (i = 1; i <= argc; i++) - printf("\t%s %s;\n", argtype[i], - argname[i]) > syscompat + printf("\t%s %s;\tchar %s_[PAD_(%s)];\n", + argtype[i], argname[i], + argname[i], argtype[i]) > syscompat printf("};\n") > syscompat } else if($2 != "CPT_NOA") - printf("struct\t%s {\n\tint dummy;\n};\n", \ + printf("struct\t%s {\n\tregister_t dummy;\n};\n", \ argalias) > sysarg printf("%s\to%s __P((struct proc *, struct %s *));\n", \ rettype, funcname, argalias) > syscompatdcl @@ -369,9 +373,11 @@ s/\$//g exit 1 } END { - printf("\n#endif /* %s */\n", compat) > syscompatdcl + printf("\n#endif /* %s */\n\n", compat) > syscompatdcl + printf("#undef PAD_\n") > syscompatdcl printf("\n#endif /* !%s */\n", sysproto_h) > syscompatdcl + printf("};\n") > sysent printf("};\n") > sysnames printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall) \ diff --git a/sys/kern/md5c.c b/sys/kern/md5c.c index 2b23ac7..d6175ee 100644 --- a/sys/kern/md5c.c +++ b/sys/kern/md5c.c @@ -22,7 +22,7 @@ * These notices must be retained in any copies of any part of this * documentation and/or software. * - * $Id: md5c.c,v 1.13 1998/04/15 17:46:21 bde Exp $ + * $Id: md5c.c,v 1.14 1998/05/01 16:40:19 bde Exp $ * * This code is the same as the code published by RSA Inc. It has been * edited for clarity and style only. @@ -44,7 +44,7 @@ #define memcpy(x,y,z) bcopy(y, x, z) #endif -#ifdef __i386__ +#if defined(__i386__) || defined(__alpha__) #define Encode memcpy #define Decode memcpy #else /* __i386__ */ diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index d35f83b..80193d4 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_log.c,v 1.28 1998/05/19 08:58:51 phk Exp $ + * $Id: subr_log.c,v 1.29 1998/05/28 09:30:20 phk Exp $ */ /* @@ -199,7 +199,7 @@ logwakeup() static int logioctl(dev, com, data, flag, p) dev_t dev; - int com; + u_long com; caddr_t data; int flag; struct proc *p; diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c index 06e7320..6145679 100644 --- a/sys/kern/subr_xxx.c +++ b/sys/kern/subr_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_xxx.c,v 1.8 1997/02/22 09:39:18 peter Exp $ + * $Id: subr_xxx.c,v 1.9 1997/09/14 02:50:28 peter Exp $ */ /* @@ -124,7 +124,7 @@ nowrite(dev, uio, ioflag) int noioctl(dev, cmd, data, flags, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flags; struct proc *p; @@ -267,7 +267,7 @@ nxwrite(dev, uio, ioflag) int nxioctl(dev, cmd, data, flags, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flags; struct proc *p; diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index c6b9320..2c8f9ae 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: sys_pipe.c,v 1.40 1998/03/26 20:51:47 phk Exp $ + * $Id: sys_pipe.c,v 1.41 1998/03/28 10:33:07 bde Exp $ */ /* @@ -93,7 +93,7 @@ static int pipe_write __P((struct file *fp, struct uio *uio, static int pipe_close __P((struct file *fp, struct proc *p)); static int pipe_poll __P((struct file *fp, int events, struct ucred *cred, struct proc *p)); -static int pipe_ioctl __P((struct file *fp, int cmd, caddr_t data, struct proc *p)); +static int pipe_ioctl __P((struct file *fp, u_long cmd, caddr_t data, struct proc *p)); static struct fileops pipeops = { pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_close }; @@ -927,7 +927,7 @@ pipe_write(fp, uio, cred) int pipe_ioctl(fp, cmd, data, p) struct file *fp; - int cmd; + u_long cmd; register caddr_t data; struct proc *p; { diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 8231b23..bc45495 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sys_process.c,v 1.36 1998/02/06 12:13:27 eivind Exp $ + * $Id: sys_process.c,v 1.37 1998/05/19 00:00:12 tegge Exp $ */ #include <sys/param.h> @@ -338,7 +338,7 @@ ptrace(curp, uap) if (uap->addr != (caddr_t)1) { fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); - if ((error = ptrace_set_pc (p, (u_int)uap->addr))) { + if ((error = ptrace_set_pc (p, (u_long)uap->addr))) { PRELE(p); return error; } @@ -406,11 +406,11 @@ ptrace(curp, uap) return (error); case PT_READ_U: - if ((u_int)uap->addr > (UPAGES * PAGE_SIZE - sizeof(int))) { + if ((u_long)uap->addr > (UPAGES * PAGE_SIZE - sizeof(long))) { return EFAULT; } if (ptrace_read_u_check(p,(vm_offset_t) uap->addr, - sizeof(int)) && + sizeof(long)) && !procfs_kmemaccess(curp)) { return EFAULT; } @@ -419,7 +419,7 @@ ptrace(curp, uap) if (p->p_flag & P_INMEM) { p->p_addr->u_kproc.kp_proc = *p; fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); - curp->p_retval[0] = *(int*)((u_int)p->p_addr + (u_int)uap->addr); + curp->p_retval[0] = *(long*)((u_long)p->p_addr + (u_long)uap->addr); } else { curp->p_retval[0] = 0; error = EFAULT; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 5814c3a..5b65bea 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 - * $Id: sys_socket.c,v 1.16 1997/09/14 02:52:15 peter Exp $ + * $Id: sys_socket.c,v 1.17 1998/03/28 10:33:07 bde Exp $ */ #include <sys/param.h> @@ -83,7 +83,7 @@ soo_write(fp, uio, cred) int soo_ioctl(fp, cmd, data, p) struct file *fp; - int cmd; + u_long cmd; register caddr_t data; struct proc *p; { diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index a26615c..bf55a2b 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ - $Id: syscalls.master,v 1.50 1998/05/11 03:55:27 dyson Exp $ + $Id: syscalls.master,v 1.51 1998/05/14 11:28:11 peter Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; ; System call name/number master file. @@ -150,7 +150,7 @@ 89 STD BSD { int getdtablesize(void); } 90 STD POSIX { int dup2(u_int from, u_int to); } 91 UNIMPL BSD getdopt -92 STD POSIX { int fcntl(int fd, int cmd, int arg); } +92 STD POSIX { int fcntl(int fd, int cmd, long arg); } ; XXX should be { int fcntl(int fd, int cmd, ...); } ; but we're not ready for varargs. ; XXX man page says `int arg' too. diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 56fc183..7793446 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -38,7 +38,7 @@ static volatile int ttyverbose = 0; * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.102 1998/03/30 09:50:54 phk Exp $ + * $Id: tty.c,v 1.103 1998/05/17 20:08:05 bde Exp $ */ /*- @@ -695,7 +695,8 @@ ttyoutput(c, tp) int ttioctl(tp, cmd, data, flag) register struct tty *tp; - int cmd, flag; + u_long cmd; + int flag; void *data; { register struct proc *p; diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index 59a3c4f..fa2ae5c 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 - * $Id: tty_compat.c,v 1.26 1998/01/25 17:25:34 steve Exp $ + * $Id: tty_compat.c,v 1.27 1998/02/25 06:16:37 bde Exp $ */ #include "opt_compat.h" @@ -99,7 +99,7 @@ ttcompatspeedtab(speed, table) int ttsetcompat(tp, com, data, term) register struct tty *tp; - int *com; + u_long *com; caddr_t data; struct termios *term; { @@ -182,7 +182,7 @@ ttsetcompat(tp, com, data, term) int ttcompat(tp, com, data, flag) register struct tty *tp; - int com; + u_long com; caddr_t data; int flag; { diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index 714a4a5..12f26e0 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty_conf.c 8.4 (Berkeley) 1/21/94 - * $Id: tty_conf.c,v 1.11 1997/12/06 13:24:04 bde Exp $ + * $Id: tty_conf.c,v 1.12 1997/12/16 17:40:27 eivind Exp $ */ #include "opt_compat.h" @@ -200,7 +200,7 @@ l_nostart(tp) static int l_nullioctl(tp, cmd, data, flags, p) struct tty *tp; - int cmd; + u_long cmd; char *data; int flags; struct proc *p; diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index a90283a..fceb4dd 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.56 1998/01/24 02:54:12 eivind Exp $ + * $Id: cons.c,v 1.57 1998/03/28 10:32:56 bde Exp $ */ #include "opt_devfs.h" @@ -352,7 +352,7 @@ cnwrite(dev, uio, flag) static int cnioctl(dev, cmd, data, flag, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flag; struct proc *p; diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index c9c24e3..7c5df09 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 - * $Id: tty_pty.c,v 1.50 1998/01/24 02:54:35 eivind Exp $ + * $Id: tty_pty.c,v 1.51 1998/02/25 06:19:15 bde Exp $ */ /* @@ -635,7 +635,7 @@ ptydevtotty(dev) static int ptyioctl(dev, cmd, data, flag, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flag; struct proc *p; diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c index 4679f01..c4b13e5 100644 --- a/sys/kern/tty_snoop.c +++ b/sys/kern/tty_snoop.c @@ -395,7 +395,7 @@ snpdown(snp) static int snpioctl(dev, cmd, data, flags, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flags; struct proc *p; diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index e5a9791..409be70 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_tty.c,v 1.22 1998/01/24 02:54:35 eivind Exp $ + * $Id: tty_tty.c,v 1.23 1998/02/20 13:46:56 bde Exp $ */ /* @@ -141,7 +141,7 @@ cttywrite(dev, uio, flag) static int cttyioctl(dev, cmd, addr, flag, p) dev_t dev; - int cmd; + u_long cmd; caddr_t addr; int flag; struct proc *p; diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 79de43c..a056020 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.35 1998/05/17 11:52:56 phk Exp $ + * $Id: uipc_socket2.c,v 1.36 1998/05/31 18:38:43 peter Exp $ */ #include <sys/param.h> @@ -839,7 +839,7 @@ pru_connect2_notsupp(struct socket *so1, struct socket *so2) } int -pru_control_notsupp(struct socket *so, int cmd, caddr_t data, +pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, struct proc *p) { return EOPNOTSUPP; diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 79de43c..a056020 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.35 1998/05/17 11:52:56 phk Exp $ + * $Id: uipc_socket2.c,v 1.36 1998/05/31 18:38:43 peter Exp $ */ #include <sys/param.h> @@ -839,7 +839,7 @@ pru_connect2_notsupp(struct socket *so1, struct socket *so2) } int -pru_control_notsupp(struct socket *so, int cmd, caddr_t data, +pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, struct proc *p) { return EOPNOTSUPP; diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 7edf44a..f4d947d 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.152 1998/04/19 23:32:03 julian Exp $ + * $Id: vfs_subr.c,v 1.153 1998/05/17 19:38:55 tegge Exp $ */ /* @@ -241,6 +241,8 @@ vfs_rootmountalloc(fstypename, devname, mpp) struct vfsconf *vfsp; struct mount *mp; + if (fstypename == NULL) + return (ENODEV); for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next) if (!strcmp(vfsp->vfc_name, fstypename)) break; diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index b79f0f5..4842c9f 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.100 1998/05/07 04:58:23 msmith Exp $ + * $Id: vfs_syscalls.c,v 1.101 1998/05/11 03:55:28 dyson Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -1004,7 +1004,7 @@ mknod(p, uap) register struct vnode *vp; struct vattr vattr; int error; - int whiteout; + int whiteout = 0; struct nameidata nd; error = suser(p->p_ucred, &p->p_acflag); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 709d863..b2d0954 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 - * $Id: vfs_lookup.c,v 1.26 1998/02/15 04:17:07 dyson Exp $ + * $Id: vfs_lookup.c,v 1.27 1998/04/08 18:31:57 wosch Exp $ */ #include "opt_ktrace.h" @@ -107,10 +107,10 @@ namei(ndp) cnp->cn_pnbuf = zalloc(namei_zone); if (ndp->ni_segflg == UIO_SYSSPACE) error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, - MAXPATHLEN, (u_int *)&ndp->ni_pathlen); + MAXPATHLEN, (size_t *)&ndp->ni_pathlen); else error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, - MAXPATHLEN, (u_int *)&ndp->ni_pathlen); + MAXPATHLEN, (size_t *)&ndp->ni_pathlen); /* * Don't allow empty pathnames. diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 7edf44a..f4d947d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.152 1998/04/19 23:32:03 julian Exp $ + * $Id: vfs_subr.c,v 1.153 1998/05/17 19:38:55 tegge Exp $ */ /* @@ -241,6 +241,8 @@ vfs_rootmountalloc(fstypename, devname, mpp) struct vfsconf *vfsp; struct mount *mp; + if (fstypename == NULL) + return (ENODEV); for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next) if (!strcmp(vfsp->vfc_name, fstypename)) break; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index b79f0f5..4842c9f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.100 1998/05/07 04:58:23 msmith Exp $ + * $Id: vfs_syscalls.c,v 1.101 1998/05/11 03:55:28 dyson Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -1004,7 +1004,7 @@ mknod(p, uap) register struct vnode *vp; struct vattr vattr; int error; - int whiteout; + int whiteout = 0; struct nameidata nd; error = suser(p->p_ucred, &p->p_acflag); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index efee10e..9d4d991 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id: vfs_vnops.c,v 1.56 1998/04/10 00:09:04 alex Exp $ + * $Id: vfs_vnops.c,v 1.57 1998/05/07 04:58:25 msmith Exp $ */ #include <sys/param.h> @@ -52,7 +52,7 @@ #include <sys/ttycom.h> static int vn_closefile __P((struct file *fp, struct proc *p)); -static int vn_ioctl __P((struct file *fp, int com, caddr_t data, +static int vn_ioctl __P((struct file *fp, u_long com, caddr_t data, struct proc *p)); static int vn_read __P((struct file *fp, struct uio *uio, struct ucred *cred)); @@ -442,7 +442,7 @@ vn_stat(vp, sb, p) static int vn_ioctl(fp, com, data, p) struct file *fp; - int com; + u_long com; caddr_t data; struct proc *p; { |