Commit 1011d8a2 by Joel Sherrill Committed by Joel Sherrill

Makefile.in: Switch RTEMS to s-interr-hwint.adb.

2008-09-10  Joel Sherrill <joel.sherrill@oarcorp.com>

	* gcc-interface/Makefile.in: Switch RTEMS to s-interr-hwint.adb.
	* s-osinte-rtems.ads: Add shared hardware interrupt adapter
	layer. RTEMS binds to OS provided adapter routines so there are
	no modifications to s-osinte-rtems.adb.

From-SVN: r140246
parent dec1b5d7
2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* gcc-interface/Makefile.in: Switch RTEMS to s-interr-hwint.adb.
* s-osinte-rtems.ads: Add shared hardware interrupt adapter
layer. RTEMS binds to OS provided adapter routines so there are
no modifications to s-osinte-rtems.adb.
2008-09-09 Arnaud Charlet <charlet@adacore.com> 2008-09-09 Arnaud Charlet <charlet@adacore.com>
Joel Sherrill <joel.sherrill@oarcorp.com> Joel Sherrill <joel.sherrill@oarcorp.com>
...@@ -1149,7 +1149,8 @@ ifeq ($(strip $(filter-out rtems%,$(osys))),) ...@@ -1149,7 +1149,8 @@ ifeq ($(strip $(filter-out rtems%,$(osys))),)
s-taprop.adb<s-taprop-posix.adb \ s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \ s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-rtems.adb \ s-tpopsp.adb<s-tpopsp-rtems.adb \
s-stchop.adb<s-stchop-rtems.adb s-stchop.adb<s-stchop-rtems.adb \
s-interr.adb<s-interr-hwint.adb
endif endif
ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),) ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
......
...@@ -88,7 +88,13 @@ package System.OS_Interface is ...@@ -88,7 +88,13 @@ package System.OS_Interface is
-- Signals -- -- Signals --
------------- -------------
Max_Interrupt : constant := 31; Num_HW_Interrupts : constant := 256;
Max_HW_Interrupt : constant := Num_HW_Interrupts - 1;
type HW_Interrupt is new int range 0 .. Max_HW_Interrupt;
Max_Interrupt : constant := Max_HW_Interrupt;
type Signal is new int range 0 .. Max_Interrupt; type Signal is new int range 0 .. Max_Interrupt;
SIGXCPU : constant := 0; -- XCPU SIGXCPU : constant := 0; -- XCPU
...@@ -501,6 +507,79 @@ package System.OS_Interface is ...@@ -501,6 +507,79 @@ package System.OS_Interface is
destructor : destructor_pointer) return int; destructor : destructor_pointer) return int;
pragma Import (C, pthread_key_create, "pthread_key_create"); pragma Import (C, pthread_key_create, "pthread_key_create");
------------------------------------------------------------
-- Binary Semaphore Wrapper to Support Interrupt Tasks --
------------------------------------------------------------
type Binary_Semaphore_Id is new rtems_id;
function Binary_Semaphore_Create return Binary_Semaphore_Id;
pragma Import (
C,
Binary_Semaphore_Create,
"__gnat_binary_semaphore_create");
function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id) return int;
pragma Import (
C,
Binary_Semaphore_Delete,
"__gnat_binary_semaphore_delete");
function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id) return int;
pragma Import (
C,
Binary_Semaphore_Obtain,
"__gnat_binary_semaphore_obtain");
function Binary_Semaphore_Release (ID : Binary_Semaphore_Id) return int;
pragma Import (
C,
Binary_Semaphore_Release,
"__gnat_binary_semaphore_release");
function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int;
pragma Import (
C,
Binary_Semaphore_Flush,
"__gnat_binary_semaphore_flush");
------------------------------------------------------------
-- Hardware Interrupt Wrappers to Support Interrupt Tasks --
------------------------------------------------------------
type Interrupt_Handler is access procedure (parameter : System.Address);
pragma Convention (C, Interrupt_Handler);
type Interrupt_Vector is new System.Address;
function Interrupt_Connect
(vector : Interrupt_Vector;
handler : Interrupt_Handler;
parameter : System.Address := System.Null_Address) return int;
pragma Import (C, Interrupt_Connect, "__gnat_interrupt_connect");
-- Use this to set up an user handler. The routine installs a
-- a user handler which is invoked after RTEMS has saved enough
-- context for a high-level language routine to be safely invoked.
function Interrupt_Vector_Get
(Vector : Interrupt_Vector) return Interrupt_Handler;
pragma Import (C, Interrupt_Vector_Get, "__gnat_interrupt_get");
-- Use this to get the existing handler for later restoral.
procedure Interrupt_Vector_Set
(Vector : Interrupt_Vector;
Handler : Interrupt_Handler);
pragma Import (C, Interrupt_Vector_Set, "__gnat_interrupt_set");
-- Use this to restore a handler obtained using Interrupt_Vector_Get.
function Interrupt_Number_To_Vector (intNum : int) return Interrupt_Vector;
-- Convert a logical interrupt number to the hardware interrupt vector
-- number used to connect the interrupt.
pragma Import (
C,
Interrupt_Number_To_Vector,
"__gnat_interrupt_number_to_vector"
);
private private
type sigset_t is new int; type sigset_t is new int;
...@@ -533,7 +612,7 @@ private ...@@ -533,7 +612,7 @@ private
schedpolicy : int; schedpolicy : int;
schedparam : struct_sched_param; schedparam : struct_sched_param;
cputime_clocked_allowed : int; cputime_clocked_allowed : int;
deatchstate : int; detatchstate : int;
end record; end record;
pragma Convention (C, pthread_attr_t); pragma Convention (C, pthread_attr_t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment