Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/arch/powerpc cosmetic fixes.
details: https://anonhg.NetBSD.org/src/rev/f4261ca5f995
branches: trunk
changeset: 503346:f4261ca5f995
user: christos <christos%NetBSD.org@localhost>
date: Sun Feb 04 22:59:26 2001 +0000
description:
cosmetic fixes.
diffstat:
sys/compat/linux/arch/powerpc/linux_errno.h | 72 +++++++++++-----------
sys/compat/linux/arch/powerpc/linux_exec.h | 11 +-
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c | 14 ++--
sys/compat/linux/arch/powerpc/linux_fcntl.h | 8 +-
sys/compat/linux/arch/powerpc/linux_machdep.c | 68 +++++++++++---------
sys/compat/linux/arch/powerpc/linux_ptrace.c | 30 +++++---
6 files changed, 108 insertions(+), 95 deletions(-)
diffs (truncated from 498 to 300 lines):
diff -r e9a380d7dc84 -r f4261ca5f995 sys/compat/linux/arch/powerpc/linux_errno.h
--- a/sys/compat/linux/arch/powerpc/linux_errno.h Sun Feb 04 22:55:26 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_errno.h Sun Feb 04 22:59:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_errno.h,v 1.1 2001/01/19 12:27:13 manu Exp $ */
+/* $NetBSD: linux_errno.h,v 1.2 2001/02/04 22:59:26 christos Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -46,57 +46,57 @@
* From Linux's include/asm-ppc/errno.h
*/
#define LINUX_ENAMETOOLONG 36
-#define LINUX_ENOLCK 37
-#define LINUX_ENOSYS 38
+#define LINUX_ENOLCK 37
+#define LINUX_ENOSYS 38
#define LINUX_ENOTEMPTY 39
-#define LINUX_ELOOP 40
+#define LINUX_ELOOP 40
#define LINUX_EWOULDBLOCK LINUX_EAGAIN
-#define LINUX_ENOMSG 42
-#define LINUX_EIDRM 43
-#define LINUX_ECHRNG 44
+#define LINUX_ENOMSG 42
+#define LINUX_EIDRM 43
+#define LINUX_ECHRNG 44
#define LINUX_EL2NSYNC 45
-#define LINUX_EL3HLT 46
-#define LINUX_EL3RST 47
-#define LINUX_ELNRNG 48
+#define LINUX_EL3HLT 46
+#define LINUX_EL3RST 47
+#define LINUX_ELNRNG 48
#define LINUX_EUNATCH 49
-#define LINUX_ENOCSI 50
-#define LINUX_EL2HLT 51
-#define LINUX_EBADE 52
-#define LINUX_EBADR 53
-#define LINUX_EXFULL 54
-#define LINUX_ENOANO 55
+#define LINUX_ENOCSI 50
+#define LINUX_EL2HLT 51
+#define LINUX_EBADE 52
+#define LINUX_EBADR 53
+#define LINUX_EXFULL 54
+#define LINUX_ENOANO 55
#define LINUX_EBADRQC 56
#define LINUX_EBADSLT 57
#define LINUX_EDEADLOCK 58
-#define LINUX_EBFONT 59
-#define LINUX_ENOSTR 60
+#define LINUX_EBFONT 59
+#define LINUX_ENOSTR 60
#define LINUX_ENODATA 61
-#define LINUX_ETIME 62
-#define LINUX_ENOSR 63
-#define LINUX_ENONET 64
-#define LINUX_ENOPKG 65
+#define LINUX_ETIME 62
+#define LINUX_ENOSR 63
+#define LINUX_ENONET 64
+#define LINUX_ENOPKG 65
#define LINUX_EREMOTE 66
#define LINUX_ENOLINK 67
-#define LINUX_EADV 68
-#define LINUX_ESRMNT 69
-#define LINUX_ECOMM 70
-#define LINUX_EPROTO 71
+#define LINUX_EADV 68
+#define LINUX_ESRMNT 69
+#define LINUX_ECOMM 70
+#define LINUX_EPROTO 71
#define LINUX_EMULTIHOP 72
#define LINUX_EDOTDOT 73
#define LINUX_EBADMSG 74
#define LINUX_EOVERFLOW 75
#define LINUX_ENOTUNIQ 76
-#define LINUX_EBADFD 77
+#define LINUX_EBADFD 77
#define LINUX_EREMCHG 78
#define LINUX_ELIBACC 79
#define LINUX_ELIBBAD 80
#define LINUX_ELIBSCN 81
#define LINUX_ELIBMAX 82
#define LINUX_ELIBEXEC 83
-#define LINUX_EILSEQ 84
+#define LINUX_EILSEQ 84
#define LINUX_ERESTART 85
#define LINUX_ESTRPIPE 86
-#define LINUX_EUSERS 87
+#define LINUX_EUSERS 87
#define LINUX_ENOTSOCK 88
#define LINUX_EDESTADDRREQ 89
#define LINUX_EMSGSIZE 90
@@ -104,10 +104,10 @@
#define LINUX_ENOPROTOOPT 92
#define LINUX_EPROTONOSUPPORT 93
#define LINUX_ESOCKTNOSUPPORT 94
-#define LINUX_EOPNOTSUPP 95
-#define LINUX_EPFNOSUPPORT 96
-#define LINUX_EAFNOSUPPORT 97
-#define LINUX_EADDRINUSE 98
+#define LINUX_EOPNOTSUPP 95
+#define LINUX_EPFNOSUPPORT 96
+#define LINUX_EAFNOSUPPORT 97
+#define LINUX_EADDRINUSE 98
#define LINUX_EADDRNOTAVAIL 99
#define LINUX_ENETDOWN 100
#define LINUX_ENETUNREACH 101
@@ -125,13 +125,13 @@
#define LINUX_EHOSTUNREACH 113
#define LINUX_EALREADY 114
#define LINUX_EINPROGRESS 115
-#define LINUX_ESTALE 116
+#define LINUX_ESTALE 116
#define LINUX_EUCLEAN 117
#define LINUX_ENOTNAM 118
#define LINUX_ENAVAIL 119
-#define LINUX_EISNAM 120
+#define LINUX_EISNAM 120
#define LINUX_EREMOTEIO 121
-#define LINUX_EDQUOT 122
+#define LINUX_EDQUOT 122
#define LINUX_ENOMEDIUM 123
#define LINUX_EMEDIUMTYPE 124
diff -r e9a380d7dc84 -r f4261ca5f995 sys/compat/linux/arch/powerpc/linux_exec.h
--- a/sys/compat/linux/arch/powerpc/linux_exec.h Sun Feb 04 22:55:26 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_exec.h Sun Feb 04 22:59:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.1 2001/01/19 01:31:23 manu Exp $ */
+/* $NetBSD: linux_exec.h,v 1.2 2001/02/04 22:59:26 christos Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -98,11 +98,11 @@
*/
#ifdef LINUX_SP_WRAP
#define LINUX_ELF_AUX_ARGSIZ \
- ((howmany(ELF_AUX_ENTRIES * sizeof(LinuxAuxInfo), sizeof(Elf32_Addr))) + 16 \
- + LINUX_SP_WRAP)
+ ((howmany(ELF_AUX_ENTRIES * sizeof(LinuxAuxInfo), sizeof(Elf32_Addr))) \
+ + 16 + LINUX_SP_WRAP)
#else
#define LINUX_ELF_AUX_ARGSIZ \
- ((howmany(ELF_AUX_ENTRIES * sizeof(LinuxAuxInfo), sizeof(Elf32_Addr))) + 16)
+ ((howmany(ELF_AUX_ENTRIES * sizeof(LinuxAuxInfo), sizeof(Elf32_Addr))) + 16)
#endif
/* XXX should use ELFNAME2 */
@@ -116,7 +116,8 @@
#ifdef _KERNEL
__BEGIN_DECLS
-void * linux_elf32_copyargs __P((struct exec_package *, struct ps_strings *, void *, void *));
+void * linux_elf32_copyargs __P((struct exec_package *,
+ struct ps_strings *, void *, void *));
__END_DECLS
#endif /* _KERNEL */
diff -r e9a380d7dc84 -r f4261ca5f995 sys/compat/linux/arch/powerpc/linux_exec_powerpc.c
--- a/sys/compat/linux/arch/powerpc/linux_exec_powerpc.c Sun Feb 04 22:55:26 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_exec_powerpc.c Sun Feb 04 22:59:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_powerpc.c,v 1.1 2001/01/19 01:36:51 manu Exp $ */
+/* $NetBSD: linux_exec_powerpc.c,v 1.2 2001/02/04 22:59:26 christos Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -105,10 +105,10 @@
#ifdef LINUX_SHIFT
/*
* From Linux's arch/ppc/kernel/process.c:shove_aux_table(). GNU ld.so
- * expects the ELF auxiliary table to start on a 16 bytes boundary on the
- * PowerPC.
+ * expects the ELF auxiliary table to start on a 16 bytes boundary on
+ * the PowerPC.
*/
- (unsigned long) stack = ((unsigned long) stack + LINUX_SHIFT) & ~LINUX_SHIFT;
+ stack = (void *)(((unsigned long) stack + LINUX_SHIFT) & ~LINUX_SHIFT);
#endif
memset(ai, 0, sizeof(LinuxAuxInfo) * LINUX_ELF_AUX_ENTRIES);
@@ -133,9 +133,9 @@
#if 1
/*
* The exec_package doesn't have a proc pointer and it's not
- * exactly trivial to add one since the credentials are changing.
- *
- * XXX Linux uses curproc's credentials. Why can't we use them too?
+ * exactly trivial to add one since the credentials are
+ * changing. XXX Linux uses curproc's credentials.
+ * Why can't we use them too?
*/
a->a_type = LINUX_AT_EGID;
a->a_v = p->p_ucred->cr_gid;
diff -r e9a380d7dc84 -r f4261ca5f995 sys/compat/linux/arch/powerpc/linux_fcntl.h
--- a/sys/compat/linux/arch/powerpc/linux_fcntl.h Sun Feb 04 22:55:26 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_fcntl.h Sun Feb 04 22:59:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.2 2001/01/21 22:19:26 manu Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.3 2001/02/04 22:59:26 christos Exp $ */
/*-
* Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
@@ -53,15 +53,15 @@
* Theses are octal values (remember 0100 != 100 in C)
*/
#define LINUX_O_CREAT 0100
-#define LINUX_O_EXCL 0200
+#define LINUX_O_EXCL 0200
#define LINUX_O_NOCTTY 0400
#define LINUX_O_TRUNC 01000
#define LINUX_O_APPEND 02000
#define LINUX_O_NONBLOCK 04000
#define LINUX_O_NDELAY LINUX_O_NONBLOCK
-#define LINUX_O_SYNC 010000
+#define LINUX_O_SYNC 010000
-#define LINUX_FASYNC 020000
+#define LINUX_FASYNC 020000
/*
* fcntl(2) operations
diff -r e9a380d7dc84 -r f4261ca5f995 sys/compat/linux/arch/powerpc/linux_machdep.c
--- a/sys/compat/linux/arch/powerpc/linux_machdep.c Sun Feb 04 22:55:26 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_machdep.c Sun Feb 04 22:59:26 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.c,v 1.3 2001/01/26 19:46:16 manu Exp $ */
+/* $NetBSD: linux_machdep.c,v 1.4 2001/02/04 22:59:26 christos Exp $ */
/*-
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
struct proc *p = curproc;
struct trapframe *tf;
struct linux_sigregs *fp, frame;
- struct linux_pt_regs linux_regs;
+ struct linux_pt_regs linux_regs;
struct linux_sigcontext sc;
int onstack;
int i;
@@ -147,11 +147,13 @@
/*
* Allocate space for the signal handler context.
*/
- if (onstack)
- fp = (struct linux_sigregs *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
+ if (onstack) {
+ fp = (struct linux_sigregs *)
+ ((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
- else
+ } else {
fp = (struct linux_sigregs *)tf->fixreg[1];
+ }
fp = (struct linux_sigregs *)((int)(fp - 1) & ~0xf);
/*
@@ -168,7 +170,7 @@
*
* Save register context.
*/
- for (i=0; i<=31; i++)
+ for (i = 0; i < 32; i++)
linux_regs.lgpr[i] = tf->fixreg[i];
linux_regs.lnip = tf->srr0;
linux_regs.lmsr = tf->srr1;
@@ -178,11 +180,11 @@
linux_regs.lxer = tf->xer;
linux_regs.lccr = tf->cr;
linux_regs.lmq = 0; /* Unused, 601 only */
- linux_regs.ltrap = 0; /* XXX What is ltrap counterpart in NetBSD ? */
+ linux_regs.ltrap = 0; /* XXX What is ltrap counterpart in NetBSD ? */
linux_regs.ldar = tf->dar;
linux_regs.ldsisr = tf->dsisr;
linux_regs.lresult = tf->exc;
- bcopy (&linux_regs, &frame.lgp_regs, sizeof (frame.lgp_regs));
+ memcpy(&frame.lgp_regs, &linux_regs, sizeof(frame.lgp_regs));
/*
* NetBSD does not uses the FPU in the kernel, so there is no
@@ -190,14 +192,14 @@
* them to be saved on the stack. Therefore we just keep a
* gap of zero'ed data where the FP registers should be stored
*/
- memset (&frame.lfp_regs, 0, sizeof (frame.lfp_regs));
+ memset(&frame.lfp_regs, 0, sizeof (frame.lfp_regs));
/*
- * Copy Linux's signal trampoline on the user stack It should not be used,
- * but Linux binaries might expect him to be there.
+ * Copy Linux's signal trampoline on the user stack It should not
+ * be used, but Linux binaries might expect him to be there.
*/
- frame.ltramp[0]=0x38997777; /* li r0, 0x7777 */
- frame.ltramp[1]=0x44000002; /* sc */
+ frame.ltramp[0] = 0x38997777; /* li r0, 0x7777 */
+ frame.ltramp[1] = 0x44000002; /* sc */
Home |
Main Index |
Thread Index |
Old Index