2003-06-26 Roland McGrath <roland@redhat.com>
* configure.ac: SHMEDIA -> SH64
* defs.h: Likewise.
* mem.c: Likewise.
* process.c: Likewise.
* sock.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.
* linux/shmedia/syscallent.h: Moved to ...
* linux/sh64/syscallent.h: ... here.
diff --git a/configure.ac b/configure.ac
index cacf956..ac20344 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,9 +91,9 @@
arch=sh
AC_DEFINE([SH], 1, [Define for the SH architecture.])
;;
-shmedia)
- arch=shmedia
- AC_DEFINE([SHMEDIA], 1, [Define for the SHmedia architecture.])
+sh64)
+ arch=sh64
+ AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
;;
x86?64*)
arch=x86_64
diff --git a/defs.h b/defs.h
index 98c75b9..ff06f4e 100644
--- a/defs.h
+++ b/defs.h
@@ -170,8 +170,8 @@
# define PT_IAOQ0 (106*4)
# define PT_IAOQ1 (107*4)
#endif /* HPPA */
-#ifdef SHMEDIA
- /* SHmedia Linux - this code assumes the following kernel API for system calls:
+#ifdef SH64
+ /* SH64 Linux - this code assumes the following kernel API for system calls:
PC Offset 0
System Call Offset 16 (actually, (syscall no.) | (0x1n << 16),
where n = no. of parameters.
@@ -185,7 +185,7 @@
# define REG_GENERAL(x) (8*(x)+REG_OFFSET)
# define REG_PC (0*8)
# define REG_SYSCALL (2*8)
-#endif /* SHMEDIA */
+#endif /* SH64 */
#endif /* LINUX */
#define SUPPORTED_PERSONALITIES 1
@@ -318,7 +318,7 @@
#define TCB_FOLLOWFORK 00400 /* Process should have forks followed */
#define TCB_REPRINT 01000 /* We should reprint this syscall on exit */
#ifdef LINUX
-# if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SHMEDIA) || defined(S390) || defined(S390X) || defined(ARM)
+# if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM)
# define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */
# endif
# define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */
diff --git a/linux/shmedia/syscallent.h b/linux/sh64/syscallent.h
similarity index 100%
rename from linux/shmedia/syscallent.h
rename to linux/sh64/syscallent.h
diff --git a/mem.c b/mem.c
index 44e67e6..f016021 100644
--- a/mem.c
+++ b/mem.c
@@ -42,7 +42,7 @@
#if defined(LINUX) && defined(I386)
#include <asm/ldt.h>
#endif
-#if defined(LINUX) && defined(SHMEDIA)
+#if defined(LINUX) && defined(SH64)
#include <asm/page.h> /* for PAGE_SHIFT */
#endif
@@ -227,7 +227,7 @@
return 0;
else
u_arg[i] = v;
-#elif defined(SH) || defined(SHMEDIA)
+#elif defined(SH) || defined(SH64)
/* SH has always passed the args in registers */
int i;
for (i=0; i<6; i++)
@@ -245,7 +245,7 @@
sys_mmap(tcp)
struct tcb *tcp;
{
-#if defined(LINUX) && defined(SHMEDIA)
+#if defined(LINUX) && defined(SH64)
/*
* Old mmap differs from new mmap in specifying the
* offset in units of bytes rather than pages. We
diff --git a/process.c b/process.c
index 800c57d..fbed809 100644
--- a/process.c
+++ b/process.c
@@ -666,7 +666,7 @@
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*(REG_REG0+3)), new)<0)
return -1;
return 0;
-#elif defined(SHMEDIA)
+#elif defined(SH64)
/* Top half of reg encodes the no. of args n as 0x1n.
Assume 0 args as kernel never actually checks... */
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_SYSCALL),
@@ -2475,7 +2475,7 @@
{ 4*REG_XDREG14, "4*REG_XDREG14" },
{ 4*REG_FPSCR, "4*REG_FPSCR" },
#endif /* SH */
-#ifdef SHMEDIA
+#ifdef SH64
{ 0, "PC(L)" },
{ 4, "PC(U)" },
{ 8, "SR(L)" },
@@ -2663,12 +2663,12 @@
{ uoff(u_dsize), "offsetof(struct user, u_dsize)" },
{ uoff(u_ssize), "offsetof(struct user, u_ssize)" },
{ uoff(start_code), "offsetof(struct user, start_code)" },
-#ifdef SHMEDIA
+#ifdef SH64
{ uoff(start_data), "offsetof(struct user, start_data)" },
#endif
{ uoff(start_stack), "offsetof(struct user, start_stack)" },
{ uoff(signal), "offsetof(struct user, signal)" },
-#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SH) && !defined(SHMEDIA)
+#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SH) && !defined(SH64)
{ uoff(reserved), "offsetof(struct user, reserved)" },
#endif
{ uoff(u_ar0), "offsetof(struct user, u_ar0)" },
diff --git a/sock.c b/sock.c
index 285a69a..7d1f244 100644
--- a/sock.c
+++ b/sock.c
@@ -35,7 +35,7 @@
#include <sys/sockio.h>
#endif
-#if defined (ALPHA) || defined(SH) || defined(SHMEDIA)
+#if defined (ALPHA) || defined(SH) || defined(SH64)
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#elif defined(HAVE_IOCTLS_H)
diff --git a/syscall.c b/syscall.c
index 3f1df49..a9022aa 100644
--- a/syscall.c
+++ b/syscall.c
@@ -713,7 +713,7 @@
static long r28;
#elif defined(SH)
static long r0;
-#elif defined(SHMEDIA)
+#elif defined(SH64)
static long r9;
#elif defined(X86_64)
static long rax;
@@ -1144,7 +1144,7 @@
return 0;
}
}
-#elif defined(SHMEDIA)
+#elif defined(SH64)
if (upeek(pid, REG_SYSCALL, &scno) < 0)
return -1;
scno &= 0xFFFF;
@@ -1156,7 +1156,7 @@
return 0;
}
}
-#endif /* SHMEDIA */
+#endif /* SH64 */
#endif /* LINUX */
#ifdef SUNOS4
if (upeek(pid, uoff(u_arg[7]), &scno) < 0)
@@ -1165,7 +1165,7 @@
/* new syscall ABI returns result in R0 */
if (upeek(pid, 4*REG_REG0, (long *)&r0) < 0)
return -1;
-#elif defined(SHMEDIA)
+#elif defined(SH64)
/* ABI defines result returned in r9 */
if (upeek(pid, REG_GENERAL(9), (long *)&r9) < 0)
return -1;
@@ -1481,7 +1481,7 @@
u_error = 0;
}
#else
-#ifdef SHMEDIA
+#ifdef SH64
/* interpret result as return value or error number */
if (r9 && (unsigned) -r9 < nerrnos) {
tcp->u_rval = -1;
@@ -1491,7 +1491,7 @@
tcp->u_rval = r9;
u_error = 0;
}
-#endif /* SHMEDIA */
+#endif /* SH64 */
#endif /* SH */
#endif /* HPPA */
#endif /* SPARC */
@@ -1699,11 +1699,11 @@
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*REG_REG0), r0) < 0)
return -1;
#else
-#ifdef SHMEDIA
+#ifdef SH64
r9 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)REG_GENERAL(9), r9) < 0)
return -1;
-#endif /* SHMEDIA */
+#endif /* SH64 */
#endif /* SH */
#endif /* HPPA */
#endif /* SPARC */
@@ -1934,7 +1934,7 @@
return -1;
}
}
-#elif defined(SHMEDIA)
+#elif defined(SH64)
{
int i;
/* Registers used by SH5 Linux system calls for parameters */
diff --git a/util.c b/util.c
index 231c9d3..c2ec5fe 100644
--- a/util.c
+++ b/util.c
@@ -974,7 +974,7 @@
#elif defined(SH)
if (upeek(tcp->pid, 4*REG_PC ,&pc) < 0)
return -1;
-#elif defined(SHMEDIA)
+#elif defined(SH64)
if (upeek(tcp->pid, REG_PC ,&pc) < 0)
return -1;
#endif
@@ -1092,7 +1092,7 @@
return;
}
tprintf("[%08lx] ", pc);
-#elif defined(SHMEDIA)
+#elif defined(SH64)
long pc;
if (upeek(tcp->pid, REG_PC, &pc) < 0) {
@@ -1245,7 +1245,7 @@
# elif defined (SH)
# define arg0_offset (4*(REG_REG0+4))
# define arg1_offset (4*(REG_REG0+5))
-# elif defined (SHMEDIA)
+# elif defined (SH64)
/* ABI defines arg0 & 1 in r2 & r3 */
# define arg0_offset (REG_OFFSET+16)
# define arg1_offset (REG_OFFSET+24)