Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/include Prepare for PPC64. Use register_t ...



details:   https://anonhg.NetBSD.org/src/rev/f3e75d6ef0fc
branches:  trunk
changeset: 535308:f3e75d6ef0fc
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Aug 14 15:41:57 2002 +0000

description:
Prepare for PPC64.  Use register_t for mtmsr/mfmsr since the msr on PPC64
is 64bits wide.  Define proper types for PPC64 if _LP64 is defined.

diffstat:

 sys/arch/powerpc/include/ansi.h  |  13 ++++++++++++-
 sys/arch/powerpc/include/cpu.h   |  10 +++++-----
 sys/arch/powerpc/include/types.h |  21 +++++++++++++--------
 3 files changed, 30 insertions(+), 14 deletions(-)

diffs (125 lines):

diff -r b7d636d6d2e6 -r f3e75d6ef0fc sys/arch/powerpc/include/ansi.h
--- a/sys/arch/powerpc/include/ansi.h   Wed Aug 14 15:38:40 2002 +0000
+++ b/sys/arch/powerpc/include/ansi.h   Wed Aug 14 15:41:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ansi.h,v 1.14 2002/08/07 08:01:57 tsubai Exp $ */
+/*     $NetBSD: ansi.h,v 1.15 2002/08/14 15:41:57 matt Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -51,14 +51,24 @@
  *     #endif
  */
 #define        _BSD_CLOCK_T_           unsigned long   /* clock() */
+#ifdef _LP64
+#define        _BSD_PTRDIFF_T_         long            /* ptr1 - ptr2 */
+#define        _BSD_SIZE_T_            unsigned long   /* sizeof() */
+#define        _BSD_SSIZE_T_           long            /* byte count or error */
+#define        _BSD_TIME_T_            int             /* time() */
+#else
 #define        _BSD_PTRDIFF_T_         int             /* ptr1 - ptr2 */
 #define        _BSD_SIZE_T_            unsigned int    /* sizeof() */
 #define        _BSD_SSIZE_T_           int             /* byte count or error */
 #define        _BSD_TIME_T_            long            /* time() */
+#endif
 #define        _BSD_CLOCKID_T_         int             /* clockid_t */
 #define        _BSD_TIMER_T_           int             /* timer_t */
 #define        _BSD_SUSECONDS_T_       int             /* suseconds_t */
 #define        _BSD_USECONDS_T_        unsigned int    /* useconds_t */
+#ifdef _LP64
+#define        _BSD_VA_LIST_           __builtin_va_list /* GCC builtin type */
+#else
 #define        _BSD_VA_LIST_           __va_list       /* va_list */
 typedef struct {
 #if __GNUC_PREREQ__(3, 0)
@@ -67,6 +77,7 @@
        char __gpr, __fpr, __pad[2];
        char *__stack, *__base;
 #endif
+#endif
 } __va_list;
 
 /*
diff -r b7d636d6d2e6 -r f3e75d6ef0fc sys/arch/powerpc/include/cpu.h
--- a/sys/arch/powerpc/include/cpu.h    Wed Aug 14 15:38:40 2002 +0000
+++ b/sys/arch/powerpc/include/cpu.h    Wed Aug 14 15:41:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.19 2002/08/06 06:14:37 chs Exp $     */
+/*     $NetBSD: cpu.h,v 1.20 2002/08/14 15:41:57 matt Exp $    */
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -41,10 +41,10 @@
 #include "opt_ppcarch.h"
 #endif
 
-#include <sys/device.h>
 #include <machine/frame.h>
 #include <machine/psl.h>
 #include <machine/intr.h>
+#include <sys/device.h>
 
 
 struct cache_info {
@@ -158,17 +158,17 @@
 
 #endif /* MULTIPROCESSOR */
 
-static __inline int
+static __inline register_t
 mfmsr(void)
 {
-       int msr;
+       register_t msr;
 
        asm volatile ("mfmsr %0" : "=r"(msr));
        return msr;
 }
 
 static __inline void
-mtmsr(int msr)
+mtmsr(register_t msr)
 {
 
        asm volatile ("mtmsr %0" : : "r"(msr));
diff -r b7d636d6d2e6 -r f3e75d6ef0fc sys/arch/powerpc/include/types.h
--- a/sys/arch/powerpc/include/types.h  Wed Aug 14 15:38:40 2002 +0000
+++ b/sys/arch/powerpc/include/types.h  Wed Aug 14 15:41:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.14 2002/07/05 18:45:21 matt Exp $  */
+/*     $NetBSD: types.h,v 1.15 2002/08/14 15:41:58 matt Exp $  */
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -37,19 +37,24 @@
 #include <sys/cdefs.h>
 #include <powerpc/int_types.h>
 
-#if defined(_KERNEL)
-typedef struct label_t {
-        int val[40]; /* double check this XXX */
-} label_t;
-#endif
-
 /* NB: This should probably be if defined(_KERNEL) */
 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
 typedef        unsigned long   paddr_t, vaddr_t;
 typedef        unsigned long   psize_t, vsize_t;
 #endif
 
-typedef int            register_t;
+#ifdef _LP64
+typedef long   register_t;
+typedef int    register32_t;
+#else
+typedef int    register_t;
+#endif
+
+#if defined(_KERNEL)
+typedef struct label_t {
+       register_t val[40]; /* double check this XXX */
+} label_t;
+#endif
 
 #define        __HAVE_CPU_COUNTER
 #define __HAVE_SYSCALL_INTERN



Home | Main Index | Thread Index | Old Index