Clean up whitespace and remove register keyword.

This commit is contained in:
des 2003-03-03 09:17:12 +00:00
parent 021faa11ac
commit 3c182bd3cd
11 changed files with 98 additions and 98 deletions

View File

@ -133,7 +133,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
#ifdef DEBUG
if (ldebug(clone)) {
printf(ARGS(clone, "flags %x, stack %x"),
printf(ARGS(clone, "flags %x, stack %x"),
(unsigned int)args->flags, (unsigned int)args->stack);
if (args->flags & CLONE_PID)
printf(LMSG("CLONE_PID not yet supported"));

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -97,7 +97,7 @@ linux_open(struct thread *td, struct linux_open_args *args)
bsd_flags = 0;
if (args->flags & LINUX_O_RDONLY)
bsd_flags |= O_RDONLY;
if (args->flags & LINUX_O_WRONLY)
if (args->flags & LINUX_O_WRONLY)
bsd_flags |= O_WRONLY;
if (args->flags & LINUX_O_RDWR)
bsd_flags |= O_RDWR;
@ -245,7 +245,7 @@ static int
getdents_common(struct thread *td, struct linux_getdents64_args *args,
int is64bit)
{
register struct dirent *bdp;
struct dirent *bdp;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
int len, reclen; /* BSD-format */
@ -735,23 +735,23 @@ int
linux_mount(struct thread *td, struct linux_mount_args *args)
{
struct ufs_args ufs;
char fstypename[MFSNAMELEN];
char mntonname[MNAMELEN], mntfromname[MNAMELEN];
char fstypename[MFSNAMELEN];
char mntonname[MNAMELEN], mntfromname[MNAMELEN];
int error;
int fsflags;
const char *fstype;
void *fsdata;
error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1,
error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1,
NULL);
if (error)
return (error);
error = copyinstr(args->specialfile, mntfromname, MFSNAMELEN - 1, NULL);
return (error);
error = copyinstr(args->specialfile, mntfromname, MFSNAMELEN - 1, NULL);
if (error)
return (error);
error = copyinstr(args->dir, mntonname, MFSNAMELEN - 1, NULL);
return (error);
error = copyinstr(args->dir, mntonname, MFSNAMELEN - 1, NULL);
if (error)
return (error);
return (error);
#ifdef DEBUG
if (ldebug(mount))
@ -782,15 +782,15 @@ linux_mount(struct thread *td, struct linux_mount_args *args)
* FreeBSD has is !ASYNC, which is our default.
*/
if (args->rwflag & LINUX_MS_RDONLY)
fsflags |= MNT_RDONLY;
fsflags |= MNT_RDONLY;
if (args->rwflag & LINUX_MS_NOSUID)
fsflags |= MNT_NOSUID;
fsflags |= MNT_NOSUID;
if (args->rwflag & LINUX_MS_NODEV)
fsflags |= MNT_NODEV;
fsflags |= MNT_NODEV;
if (args->rwflag & LINUX_MS_NOEXEC)
fsflags |= MNT_NOEXEC;
fsflags |= MNT_NOEXEC;
if (args->rwflag & LINUX_MS_REMOUNT)
fsflags |= MNT_UPDATE;
fsflags |= MNT_UPDATE;
}
return (vfs_mount(td, fstype, mntonname, fsflags, fsdata));

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -260,7 +260,7 @@ linux_ipc_perm_to_ipc64_perm(struct l_ipc_perm *in, struct l_ipc64_perm *out)
out->mode = in->mode;
out->seq = in->seq;
}
static int
linux_msqid_pullup(l_int ver, struct l_msqid_ds *linux_msqid, caddr_t uaddr)
{
@ -531,7 +531,7 @@ linux_semctl(struct thread *td, struct linux_semctl_args *args)
error = __semctl(td, &bsd_args);
if (error)
return error;
td->td_retval[0] = IXSEQ_TO_IPCID(bsd_args.semid,
td->td_retval[0] = IXSEQ_TO_IPCID(bsd_args.semid,
unptr->buf->sem_perm);
bsd_to_linux_semid_ds(unptr->buf, &linux_semid);
return (linux_semid_pushdown(args->cmd & LINUX_IPC_64,
@ -567,10 +567,10 @@ int
linux_msgsnd(struct thread *td, struct linux_msgsnd_args *args)
{
struct msgsnd_args /* {
int msqid;
void *msgp;
size_t msgsz;
int msgflg;
int msqid;
void *msgp;
size_t msgsz;
int msgflg;
} */ bsd_args;
bsd_args.msqid = args->msqid;
@ -583,13 +583,13 @@ linux_msgsnd(struct thread *td, struct linux_msgsnd_args *args)
int
linux_msgrcv(struct thread *td, struct linux_msgrcv_args *args)
{
struct msgrcv_args /* {
int msqid;
void *msgp;
size_t msgsz;
long msgtyp;
int msgflg;
} */ bsd_args;
struct msgrcv_args /* {
int msqid;
void *msgp;
size_t msgsz;
long msgtyp;
int msgflg;
} */ bsd_args;
bsd_args.msqid = args->msqid;
bsd_args.msgp = args->msgp;
@ -604,7 +604,7 @@ linux_msgget(struct thread *td, struct linux_msgget_args *args)
{
struct msgget_args /* {
key_t key;
int msgflg;
int msgflg;
} */ bsd_args;
bsd_args.key = args->key;
@ -616,7 +616,7 @@ int
linux_msgctl(struct thread *td, struct linux_msgctl_args *args)
{
struct msgctl_args /* {
int msqid;
int msqid;
int cmd;
struct msqid_ds *buf;
} */ bsd_args;

View File

@ -566,20 +566,20 @@ linux_select(struct thread *td, struct linux_select_args *args)
return error;
}
int
int
linux_mremap(struct thread *td, struct linux_mremap_args *args)
{
struct munmap_args /* {
void *addr;
size_t len;
} */ bsd_args;
} */ bsd_args;
int error = 0;
#ifdef DEBUG
if (ldebug(mremap))
printf(ARGS(mremap, "%p, %08lx, %08lx, %08lx"),
(void *)args->addr,
(unsigned long)args->old_len,
(void *)args->addr,
(unsigned long)args->old_len,
(unsigned long)args->new_len,
(unsigned long)args->flags);
#endif
@ -913,9 +913,9 @@ linux_setitimer(struct thread *td, struct linux_setitimer_args *args)
return error;
#ifdef DEBUG
if (ldebug(setitimer)) {
printf("setitimer: value: sec: %ld, usec: %ld\n",
printf("setitimer: value: sec: %ld, usec: %ld\n",
foo.it_value.tv_sec, foo.it_value.tv_usec);
printf("setitimer: interval: sec: %ld, usec: %ld\n",
printf("setitimer: interval: sec: %ld, usec: %ld\n",
foo.it_interval.tv_sec, foo.it_interval.tv_usec);
}
#endif

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -551,7 +551,7 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
/*
* XXX: Avoid undefined symbol error with an IPv4 only
* kernel.
*/
*/
&& ip6_v6only
#endif
) {

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -141,7 +141,7 @@ linux_newlstat(struct thread *td, struct linux_newlstat_args *args)
LFREEPATH(path);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE(&nd, NDF_ONLY_PNBUF);
error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
vput(nd.ni_vp);
@ -264,7 +264,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
linux_statfs.f_blocks = bsd_statfs->f_blocks;
linux_statfs.f_bfree = bsd_statfs->f_bfree;
linux_statfs.f_bavail = bsd_statfs->f_bavail;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_files = bsd_statfs->f_files;
linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
@ -308,7 +308,7 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)
linux_statfs.f_blocks = bsd_statfs->f_blocks;
linux_statfs.f_bfree = bsd_statfs->f_bfree;
linux_statfs.f_bavail = bsd_statfs->f_bavail;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_files = bsd_statfs->f_files;
linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
@ -318,7 +318,7 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)
return error;
}
struct l_ustat
struct l_ustat
{
l_daddr_t f_tfree;
l_ino_t f_tinode;
@ -460,7 +460,7 @@ linux_lstat64(struct thread *td, struct linux_lstat64_args *args)
LFREEPATH(filename);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE(&nd, NDF_ONLY_PNBUF);
error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
vput(nd.ni_vp);

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the

View File

@ -9,7 +9,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -137,7 +137,7 @@ exec_linux_imgact(struct image_params *imgp)
*/
vmaddr = virtual_offset;
error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
a_out->a_text + a_out->a_data + bss_size, FALSE,
a_out->a_text + a_out->a_data + bss_size, FALSE,
VM_PROT_ALL, VM_PROT_ALL, 0);
if (error)
goto fail;
@ -150,7 +150,7 @@ exec_linux_imgact(struct image_params *imgp)
goto fail;
error = copyout((void *)(buffer + file_offset),
(void *)vmaddr, a_out->a_text + a_out->a_data);
(void *)vmaddr, a_out->a_text + a_out->a_data);
vm_map_remove(kernel_map, buffer,
buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
@ -163,9 +163,9 @@ exec_linux_imgact(struct image_params *imgp)
*/
error = vm_map_protect(&vmspace->vm_map,
vmaddr,
vmaddr + a_out->a_text,
VM_PROT_EXECUTE|VM_PROT_READ,
TRUE);
vmaddr + a_out->a_text,
VM_PROT_EXECUTE|VM_PROT_READ,
TRUE);
if (error)
goto fail;
}
@ -179,13 +179,13 @@ exec_linux_imgact(struct image_params *imgp)
vmaddr = virtual_offset;
error = vm_mmap(&vmspace->vm_map, &vmaddr,
a_out->a_text + a_out->a_data,
VM_PROT_READ | VM_PROT_EXECUTE,
VM_PROT_ALL,
MAP_PRIVATE | MAP_FIXED,
(caddr_t)imgp->vp, file_offset);
VM_PROT_READ | VM_PROT_EXECUTE,
VM_PROT_ALL,
MAP_PRIVATE | MAP_FIXED,
(caddr_t)imgp->vp, file_offset);
if (error)
goto fail;
#ifdef DEBUG
printf("imgact: startaddr=%08lx, length=%08lx\n",
(u_long)vmaddr, a_out->a_text + a_out->a_data);
@ -200,13 +200,13 @@ exec_linux_imgact(struct image_params *imgp)
FALSE);
if (error)
goto fail;
/*
* Allocate anon demand-zeroed area for uninitialized data
*/
if (bss_size != 0) {
vmaddr = virtual_offset + a_out->a_text + a_out->a_data;
error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
bss_size, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0);
if (error)
goto fail;
@ -229,7 +229,7 @@ exec_linux_imgact(struct image_params *imgp)
/* Fill in image_params */
imgp->interpreted = 0;
imgp->entry_addr = a_out->a_entry;
imgp->proc->p_sysent = &linux_sysvec;
fail:

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -318,7 +318,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
#ifdef DEBUG
if (ldebug(clone)) {
printf(ARGS(clone, "flags %x, stack %x"),
printf(ARGS(clone, "flags %x, stack %x"),
(unsigned int)args->flags, (unsigned int)args->stack);
if (args->flags & CLONE_PID)
printf(LMSG("CLONE_PID not yet supported"));
@ -395,9 +395,9 @@ linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
#ifdef DEBUG
if (ldebug(mmap2))
printf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"),
(void *)args->addr, args->len, args->prot,
args->flags, args->fd, args->pgoff);
printf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"),
(void *)args->addr, args->len, args->prot,
args->flags, args->fd, args->pgoff);
#endif
linux_args.addr = (l_caddr_t)args->addr;

View File

@ -346,7 +346,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
break;
#endif
/* FALL THROUGH */
case PTRACE_GETFPXREGS: {
case PTRACE_GETFPXREGS: {
#ifdef CPU_ENABLE_SSE
struct proc *p;
struct thread *td2;
@ -449,7 +449,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
map_regs_from_linux(&u.bsd_reg, &r.reg);
error = kern_ptrace(td, PT_SETREGS, pid, &u.bsd_reg, 0);
}
/*
* Simulate debug registers access
*/
@ -459,7 +459,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
0);
if (error != 0)
break;
uap->addr -= LINUX_DBREG_OFFSET;
if (req == PTRACE_PEEKUSR) {
error = copyout((char *)&u.bsd_dbreg +

View File

@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@ -115,15 +115,15 @@ static void linux_sendsig(sig_t catcher, int sig, sigset_t *mask,
* Linux syscalls return negative errno's, we do positive and map them
*/
static int bsd_to_linux_errno[ELAST + 1] = {
-0, -1, -2, -3, -4, -5, -6, -7, -8, -9,
-10, -35, -12, -13, -14, -15, -16, -17, -18, -19,
-20, -21, -22, -23, -24, -25, -26, -27, -28, -29,
-30, -31, -32, -33, -34, -11,-115,-114, -88, -89,
-90, -91, -92, -93, -94, -95, -96, -97, -98, -99,
-0, -1, -2, -3, -4, -5, -6, -7, -8, -9,
-10, -35, -12, -13, -14, -15, -16, -17, -18, -19,
-20, -21, -22, -23, -24, -25, -26, -27, -28, -29,
-30, -31, -32, -33, -34, -11,-115,-114, -88, -89,
-90, -91, -92, -93, -94, -95, -96, -97, -98, -99,
-100,-101,-102,-103,-104,-105,-106,-107,-108,-109,
-110,-111, -40, -36,-112,-113, -39, -11, -87,-122,
-116, -66, -6, -6, -6, -6, -6, -37, -38, -9,
-6, -6, -43, -42, -75, -6, -84
-6, -6, -43, -42, -75, -6, -84
};
int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
@ -230,9 +230,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
{
Elf32_Auxargs *args = (Elf32_Auxargs *)imgp->auxargs;
register_t *pos;
pos = *stack_base + (imgp->argc + imgp->envc + 2);
pos = *stack_base + (imgp->argc + imgp->envc + 2);
if (args->trace)
AUXARGS_ENTRY(pos, AT_DEBUG, 1);
if (args->execfd != -1)
@ -251,8 +251,8 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
PROC_UNLOCK(imgp->proc);
AUXARGS_ENTRY(pos, AT_NULL, 0);
free(imgp->auxargs, M_TEMP);
free(imgp->auxargs, M_TEMP);
imgp->auxargs = NULL;
(*stack_base)--;
@ -266,9 +266,9 @@ extern unsigned long linux_sznonrtsigcode;
static void
linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
{
register struct thread *td = curthread;
register struct proc *p = td->td_proc;
register struct trapframe *regs;
struct thread *td = curthread;
struct proc *p = td->td_proc;
struct trapframe *regs;
struct l_rt_sigframe *fp, frame;
int oonstack;
@ -371,7 +371,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
* Build context to run handler in.
*/
regs->tf_esp = (int)fp;
regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode) +
regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode) +
linux_sznonrtsigcode;
regs->tf_eflags &= ~(PSL_T | PSL_VM);
regs->tf_cs = _ucodesel;
@ -396,9 +396,9 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
static void
linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
{
register struct thread *td = curthread;
register struct proc *p = td->td_proc;
register struct trapframe *regs;
struct thread *td = curthread;
struct proc *p = td->td_proc;
struct trapframe *regs;
struct l_sigframe *fp, frame;
l_sigset_t lmask;
int oonstack, i;
@ -508,7 +508,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
{
struct proc *p = td->td_proc;
struct l_sigframe frame;
register struct trapframe *regs;
struct trapframe *regs;
l_sigset_t lmask;
int eflags, i;
@ -542,7 +542,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
* allowing it is fairly harmless.
*/
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF))
return(EINVAL);
return(EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@ -605,7 +605,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
struct l_sigcontext *context;
l_stack_t *lss;
stack_t ss;
register struct trapframe *regs;
struct trapframe *regs;
int eflags;
regs = td->td_frame;
@ -640,7 +640,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
* allowing it is fairly harmless.
*/
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF))
return(EINVAL);
return(EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@ -757,12 +757,12 @@ linux_aout_coredump(struct thread *td, struct vnode *vp, off_t limit)
(caddr_t)trunc_page(USRSTACK - ctob(vm->vm_ssize)),
round_page(ctob(vm->vm_ssize)),
(off_t)ctob(uarea_pages + kstack_pages) +
ctob(vm->vm_dsize), UIO_USERSPACE,
ctob(vm->vm_dsize), UIO_USERSPACE,
IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td);
return (error);
}
/*
* If a linux binary is exec'ing something, try this image activator
* If a linux binary is exec'ing something, try this image activator
* first. We override standard shell script execution in order to
* be able to modify the interpreter path. We only do this if a linux
* binary is doing the exec, so we do not create an EXEC module for it.
@ -810,12 +810,12 @@ struct sysentvec linux_sysvec = {
0xff,
LINUX_SIGTBLSZ,
bsd_to_linux_signal,
ELAST + 1,
ELAST + 1,
bsd_to_linux_errno,
translate_traps,
linux_fixup,
linux_sendsig,
linux_sigcode,
linux_sigcode,
&linux_szsigcode,
linux_prepsyscall,
"Linux a.out",