l4-hurd
[Top][All Lists]
Advanced

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

[PATCH] libl4 updates for PowerPC


From: Peter Bruin
Subject: [PATCH] libl4 updates for PowerPC
Date: Mon, 2 Aug 2004 15:49:58 +0200
User-agent: Internet Messaging Program (IMP) 3.2.1

Hi,

These are a couple of (trivial) changes to libl4 to make it compile on
the PowerPC again.  They mostly seem to have to do with little changes
in the libl4 implementation after the PPC files were written.

Thanks,
Peter


2004-08-02  Peter Bruin  <address@hidden>

        * powerpc/l4/bits/vregs.h (_L4_my_local_id): Remove variable
        ID, and return the desired value directly.
        (_L4_my_global_id): Likewise.
        (_L4_pager): Remove variable THREAD, and return the desired value
        directly.
        (_L4_exception_handler): Likewise.
        (_L4_intended_receiver): Likewise.
        (_L4_actual_sender): Likewise.
        (_L4_set_pager): Use `thread' instead of `thread.raw'.
        (_L4_set_exception_handler): Likewise.
        (_L4_set_virtual_sender): Likewise.
        (_L4_xfer_timeout): Rename function to _L4_xfer_timeouts.
        (_L4_set_xfer_timeout): Rename function to _L4_set_xfer_timeouts.

        * powerpc/l4/bits/syscall.h (_L4_kernel_interface): Change return
        type to _L4_kip_t.
        (_L4_memory_control): Change return type to _L4_word_t.  Rename
        variable CTRL to CTRL_RESULT and use it to hold the return value
        of the system call.

        * l4/compat/thread.h (L4_Set_XferTimeouts): Do not return a value.
        * l4/gnu/thread.h (l4_set_xfer_timeouts): Likewise.


Index: libl4/l4/compat/thread.h
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/libl4/l4/compat/thread.h,v
retrieving revision 1.1
diff -u -r1.1 thread.h
--- libl4/l4/compat/thread.h    16 Mar 2004 03:34:03 -0000      1.1
+++ libl4/l4/compat/thread.h    1 Aug 2004 22:26:31 -0000
@@ -287,7 +287,7 @@
 _L4_attribute_always_inline
 L4_Set_XferTimeouts (L4_Word_t NewValue)
 {
-  return _L4_set_xfer_timeouts (NewValue);
+  _L4_set_xfer_timeouts (NewValue);
 }
 
 
Index: libl4/l4/gnu/thread.h
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/libl4/l4/gnu/thread.h,v
retrieving revision 1.2
diff -u -r1.2 thread.h
--- libl4/l4/gnu/thread.h       10 Apr 2004 16:51:44 -0000      1.2
+++ libl4/l4/gnu/thread.h       1 Aug 2004 22:26:31 -0000
@@ -271,7 +271,7 @@
 _L4_attribute_always_inline
 l4_set_xfer_timeouts (l4_word_t timeouts)
 {
-  return _L4_set_xfer_timeouts (timeouts);
+  _L4_set_xfer_timeouts (timeouts);
 }
 
 
Index: libl4/powerpc/l4/bits/syscall.h
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/libl4/powerpc/l4/bits/syscall.h,v
retrieving revision 1.6
diff -u -r1.6 syscall.h
--- libl4/powerpc/l4/bits/syscall.h     16 Mar 2004 03:34:03 -0000      1.6
+++ libl4/powerpc/l4/bits/syscall.h     1 Aug 2004 22:26:31 -0000
@@ -44,7 +44,7 @@
 /* Return the pointer to the kernel interface page, the API version,
    the API flags, and the kernel ID.  */
 
-static inline l4_kip_t
+static inline _L4_kip_t
 _L4_attribute_always_inline _L4_attribute_const
 _L4_kernel_interface (_L4_api_version_t *api_version,
                      _L4_api_flags_t *api_flags,
@@ -334,11 +334,11 @@
 }
 
 
-static inline void
+static inline _L4_word_t
 _L4_attribute_always_inline
 _L4_memory_control (_L4_word_t control, _L4_word_t *attributes)
 {
-  register _L4_word_t ctrl asm ("r3") = control;
+  register _L4_word_t ctrl_result asm ("r3") = control;
   register _L4_word_t attr0 asm ("r4") = attributes[0];
   register _L4_word_t attr1 asm ("r5") = attributes[1];
   register _L4_word_t attr2 asm ("r6") = attributes[2];
@@ -346,9 +346,11 @@
 
   __asm__ __volatile__ ("mtctr %[addr]\n"
                        "bctrl\n"
-                       :
-                       : "r" (ctrl), "r" (attr0), "r" (attr1),
+                       : "+r" (ctrl_result)
+                       : "r" (ctrl_result), "r" (attr0), "r" (attr1),
                        "r" (attr2), "r" (attr3),
                        [addr] "r" (__l4_memory_control)
                        : "r8", "r9", "r10", __L4_PPC_CLOB);
+
+  return ctrl_result;
 }
Index: libl4/powerpc/l4/bits/vregs.h
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/libl4/powerpc/l4/bits/vregs.h,v
retrieving revision 1.2
diff -u -r1.2 vregs.h
--- libl4/powerpc/l4/bits/vregs.h       16 Mar 2004 03:34:03 -0000      1.2
+++ libl4/powerpc/l4/bits/vregs.h       1 Aug 2004 22:26:32 -0000
@@ -60,12 +60,8 @@
 _L4_attribute_always_inline
 _L4_my_local_id (void)
 {
-  _L4_thread_id_t id;
-
   /* Local thread ID is equal to the UTCB address.  */
-  id.raw = (_L4_word_t) _L4_utcb ();
-
-  return id;
+  return (_L4_word_t) _L4_utcb ();
 }
 
 
@@ -74,11 +70,9 @@
 _L4_attribute_always_inline
 _L4_my_global_id (void)
 {
-  _L4_thread_id_t id;
   _L4_word_t *utcb = _L4_utcb ();
 
-  id.raw = utcb[_L4_UTCB_MY_GLOBAL_ID];
-  return id;
+  return utcb[_L4_UTCB_MY_GLOBAL_ID];
 }
 
 
@@ -116,11 +110,9 @@
 _L4_attribute_always_inline
 _L4_pager (void)
 {
-  _L4_thread_id_t thread;
   _L4_word_t *utcb = _L4_utcb ();
 
-  thread.raw = utcb[_L4_UTCB_PAGER];
-  return thread;
+  return utcb[_L4_UTCB_PAGER];
 }
 
 
@@ -130,7 +122,7 @@
 {
   _L4_word_t *utcb = _L4_utcb ();
 
-  utcb[_L4_UTCB_PAGER] = thread.raw;
+  utcb[_L4_UTCB_PAGER] = thread;
 }
 
 
@@ -138,11 +130,9 @@
 _L4_attribute_always_inline
 _L4_exception_handler (void)
 {
-  _L4_thread_id_t thread;
   _L4_word_t *utcb = _L4_utcb ();
 
-  thread.raw = utcb[_L4_UTCB_EXC_HANDLER];
-  return thread;
+  return utcb[_L4_UTCB_EXC_HANDLER];
 }
 
 
@@ -152,7 +142,7 @@
 {
   _L4_word_t *utcb = _L4_utcb ();
 
-  utcb[_L4_UTCB_EXC_HANDLER] = thread.raw;
+  utcb[_L4_UTCB_EXC_HANDLER] = thread;
 }
 
 
@@ -270,7 +260,7 @@
 
 static inline _L4_word_t
 _L4_attribute_always_inline
-_L4_xfer_timeout (void)
+_L4_xfer_timeouts (void)
 {
   _L4_word_t *utcb = _L4_utcb ();
 
@@ -280,7 +270,7 @@
 
 static inline void
 _L4_attribute_always_inline
-_L4_set_xfer_timeout (_L4_word_t time)
+_L4_set_xfer_timeouts (_L4_word_t time)
 {
   _L4_word_t *utcb = _L4_utcb ();
 
@@ -292,11 +282,9 @@
 _L4_attribute_always_inline
 _L4_intended_receiver (void)
 {
-  _L4_thread_id_t thread;
   _L4_word_t *utcb = _L4_utcb ();
 
-  thread.raw = utcb[_L4_UTCB_RECEIVER];
-  return thread;
+  return utcb[_L4_UTCB_RECEIVER];
 }
 
 
@@ -304,11 +292,9 @@
 _L4_attribute_always_inline
 _L4_actual_sender (void)
 {
-  _L4_thread_id_t thread;
   _L4_word_t *utcb = _L4_utcb ();
 
-  thread.raw = utcb[_L4_UTCB_SENDER];
-  return thread;
+  return utcb[_L4_UTCB_SENDER];
 }
 
 
@@ -318,7 +304,7 @@
 {
   _L4_word_t *utcb = _L4_utcb ();
 
-  utcb[_L4_UTCB_SENDER] = thread.raw;
+  utcb[_L4_UTCB_SENDER] = thread;
 }
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]