Skip to contentSkip to conversation

re-add required code to include/asm-v850/unistd.h

PATCH In review Adrian Bunk 3 participants 4 messages Jul 7, 2007 – Jul 13, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 re-add required code to include/asm-v850/unistd.h

Commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 removed a bit too much, resulting in the following compile error:

<-- snip -->

...
CC arch/v850/kernel/process.o
/home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c: In function 'kernel_thread':
/home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:77: error: syntax error before 'SYSCALL_NUM' /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:78: error: syntax error before 'SYSCALL_ARG0' /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:79: error: syntax error before 'SYSCALL_RET' /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:86: error: 'arg0' undeclared (first use in this function) /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:86: error: (Each undeclared identifier is reported only once /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:86: error: for each function it appears in.) /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:87: error: 'syscall' undeclared (first use in this function) /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:88: error: syntax error before 'SYSCALL_SHORT_TRAP' /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:93: error: 'ret' undeclared (first use in this function) /home/bunk/linux/kernel-2.6/linux-2.6.22-rc6-mm1/arch/v850/kernel/process.c:97: error: syntax error before 'SYSCALL_SHORT_TRAP' make[2]: *** [arch/v850/kernel/process.o] Error 1

<-- snip -->

---

 include/asm-v850/unistd.h |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
include/asm-v850/unistd.h renamed from include/asm-v850/unistd.h.old +30 -0
@@ -206,6 +206,36 @@
 
 #ifdef __KERNEL__
 
+/* Syscall protocol:
+   Syscall number in r12, args in r6-r9, r13-r14
+   Return value in r10
+   Trap 0 for `short' syscalls, where all the args can fit in function
+   call argument registers, and trap 1 when there are additional args in
+   r13-r14.  */
+
+#define SYSCALL_NUM    "r12"
+#define SYSCALL_ARG0   "r6"
+#define SYSCALL_ARG1   "r7"
+#define SYSCALL_ARG2   "r8"
+#define SYSCALL_ARG3   "r9"
+#define SYSCALL_ARG4   "r13"
+#define SYSCALL_ARG5   "r14"
+#define SYSCALL_RET    "r10"
+
+#define SYSCALL_SHORT_TRAP     "0"
+#define SYSCALL_LONG_TRAP      "1"
+
+/* Registers clobbered by any syscall.  This _doesn't_ include the syscall
+   number (r12) or the `extended arg' registers (r13, r14), even though
+   they are actually clobbered too (this is because gcc's `asm' statement
+   doesn't allow a clobber to be used as an input or output).  */
+#define SYSCALL_CLOBBERS       "r1", "r5", "r11", "r15", "r16", \
+                               "r17", "r18", "r19"
+
+/* Registers clobbered by a `short' syscall.  This includes all clobbers
+   except the syscall number (r12).  */
+#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14"
+
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
#1 lore raw
Quoted 3 lines · Adrian Bunk

Commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 removed a bit too much, resulting in the following compile error:

Sorry about the trouble this has caused you.

Quoted 22 lines

 #ifdef __KERNEL__

include/asm-v850/unistd.h renamed from include/asm-v850/unistd.h.old +20 -0
+/* Syscall protocol:
+   Syscall number in r12, args in r6-r9, r13-r14
+   Return value in r10
+   Trap 0 for `short' syscalls, where all the args can fit in function
+   call argument registers, and trap 1 when there are additional args in
+   r13-r14.  */
+
+#define SYSCALL_NUM    "r12"
+#define SYSCALL_ARG0   "r6"
+#define SYSCALL_ARG1   "r7"
+#define SYSCALL_ARG2   "r8"
+#define SYSCALL_ARG3   "r9"
+#define SYSCALL_ARG4   "r13"
+#define SYSCALL_ARG5   "r14"
+#define SYSCALL_RET    "r10"
+
+#define SYSCALL_SHORT_TRAP     "0"
+#define SYSCALL_LONG_TRAP      "1"
+
+/* Registers clobbered by any syscall.  This _doesn't_ include the syscall

include/asm-v850/unistd.h line 238

Quoted 10 lines
include/asm-v850/unistd.h renamed from include/asm-v850/unistd.h.old +10 -0
+   number (r12) or the `extended arg' registers (r13, r14), even though
+   they are actually clobbered too (this is because gcc's `asm' statement
+   doesn't allow a clobber to be used as an input or output).  */
+#define SYSCALL_CLOBBERS       "r1", "r5", "r11", "r15", "r16", \
+                               "r17", "r18", "r19"
+
+/* Registers clobbered by a `short' syscall.  This includes all clobbers
+   except the syscall number (r12).  */
+#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14"
+

Wouldn't it be more appropriate to just open-code the contents of these macros in the place where they are used?

Even better probably would be to convert the v850 kernel_thread code to call do_fork directly, like most other architectures do.

	Arnd <><
#2 lore raw
Quoted 6 lines · Arnd Bergmann
Quoted 3 lines · Adrian Bunk

Commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 removed a bit too much, resulting in the following compile error:

Sorry about the trouble this has caused you.

No problem, I only ran into it when doing crosscompile tests.

Quoted 36 lines
Quoted 22 lines

 #ifdef __KERNEL__

include/asm-v850/unistd.h renamed from include/asm-v850/unistd.h.old +20 -0
+/* Syscall protocol:
+   Syscall number in r12, args in r6-r9, r13-r14
+   Return value in r10
+   Trap 0 for `short' syscalls, where all the args can fit in function
+   call argument registers, and trap 1 when there are additional args in
+   r13-r14.  */
+
+#define SYSCALL_NUM    "r12"
+#define SYSCALL_ARG0   "r6"
+#define SYSCALL_ARG1   "r7"
+#define SYSCALL_ARG2   "r8"
+#define SYSCALL_ARG3   "r9"
+#define SYSCALL_ARG4   "r13"
+#define SYSCALL_ARG5   "r14"
+#define SYSCALL_RET    "r10"
+
+#define SYSCALL_SHORT_TRAP     "0"
+#define SYSCALL_LONG_TRAP      "1"
+
+/* Registers clobbered by any syscall.  This _doesn't_ include the syscall

include/asm-v850/unistd.h line 238

Quoted 10 lines
include/asm-v850/unistd.h renamed from include/asm-v850/unistd.h.old +10 -0
+   number (r12) or the `extended arg' registers (r13, r14), even though
+   they are actually clobbered too (this is because gcc's `asm' statement
+   doesn't allow a clobber to be used as an input or output).  */
+#define SYSCALL_CLOBBERS       "r1", "r5", "r11", "r15", "r16", \
+                               "r17", "r18", "r19"
+
+/* Registers clobbered by a `short' syscall.  This includes all clobbers
+   except the syscall number (r12).  */
+#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14"
+

Wouldn't it be more appropriate to just open-code the contents of these macros in the place where they are used?

Quoted 2 lines

Even better probably would be to convert the v850 kernel_thread code to call do_fork directly, like most other architectures do.

The bigger problem seems to be that v850 is not that near at compiling at all... :-(

Quoted 1 line
	Arnd <><

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 8 lines · Adrian Bunk
Quoted 5 lines

Wouldn't it be more appropriate to just open-code the contents of these macros in the place where they are used?

Even better probably would be to convert the v850 kernel_thread code to call do_fork directly, like most other architectures do.

The bigger problem seems to be that v850 is not that near at compiling at all... :-(

Yeah, I'm working on other things these days, so I only check up on the v850 port occasionally.

I'll see what I can do to get things working again.

Thanks,

-Miles

Signature · 2 lines
"Most attacks seem to take place at night, during a rainstorm, uphill,
 where four map sheets join."   -- Anon. British Officer in WW I