From: mgh Date: Tue, 27 Jan 2009 12:53:05 +0000 (+0000) Subject: Removed fosa/marte_non_local_jump directory (now part of MaRTE OS) X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fosa.git/commitdiff_plain/ecebbe1af069c135f8db8bfe03f7cccd38a1fdac Removed fosa/marte_non_local_jump directory (now part of MaRTE OS) git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@1495 35b4ef3e-fd22-0410-ab77-dab3279adceb --- diff --git a/marte_non_local_jump/Makefile b/marte_non_local_jump/Makefile deleted file mode 100644 index 58eb743..0000000 --- a/marte_non_local_jump/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -all: non_local_jump_test.exe - -non_local_jump_test.exe: non_local_jump_test.adb - mgnatmake -Imarte_src_dirs -o $@ $< - - -clean: - rm -f *.o *.exe *.ali b~* mprogram* - diff --git a/marte_non_local_jump/Makefile.omk b/marte_non_local_jump/Makefile.omk deleted file mode 100644 index 9aa9efe..0000000 --- a/marte_non_local_jump/Makefile.omk +++ /dev/null @@ -1 +0,0 @@ -include_HEADERS = $(notdir $(wildcard $(SOURCES_DIR)/*.h)) diff --git a/marte_non_local_jump/context.adb b/marte_non_local_jump/context.adb deleted file mode 100644 index 2b0a972..0000000 --- a/marte_non_local_jump/context.adb +++ /dev/null @@ -1,62 +0,0 @@ ------------------------------------------------------------------------------- --- ------------------ M a R T E O S ------------------- -- ------------------------------------------------------------------------------- --- {MARTE_VERSION} --- --- 'C o n t e x t' --- --- Body --- --- File 'context.adb' By MAR --- --- Processor context for non-local jumps --- --- IMPORTANT: it must be compiled without any optimization!! --- --- {MARTE_COPYRIGHT} --- ------------------------------------------------------------------------------- --- {} ------------------------------------------------------------------- -with Text_IO; use Text_IO; -with Marte.Integer_Types; -with Non_Local_Jump; -with System; - -use type Marte.Integer_Types.Unsigned_32; - -package body Context is - - Jmp_Buff : aliased Non_Local_Jump.Jmp_Context; - pragma Volatile (Jmp_Buff); - - TCB : System.Address := System.Null_Address; - pragma Volatile (TCB); - - function Pthread_Self return System.Address; - pragma Import (C, Pthread_Self, "pthread_self"); - - function Execute_Work(Work : Work_Acc) return Integer is - begin - Put_Line ("Start work"); - TCB := Pthread_Self; - Non_Local_Jump.Save_Context(Jmp_Buff'Access); - if Non_Local_Jump.After_Jump (Jmp_Buff'Access) = 0 then - Put_Line ("---Not After Jump---"); - Work.all; - return 0; - else - Put_Line ("---After Jump---"); - return 1; - end if; - end Execute_Work; - - procedure Restore_Work is - begin - Non_Local_Jump.Restore_Context (TCB, Jmp_Buff'Access); - end Restore_Work; - -end Context; diff --git a/marte_non_local_jump/context.ads b/marte_non_local_jump/context.ads deleted file mode 100644 index c01e67e..0000000 --- a/marte_non_local_jump/context.ads +++ /dev/null @@ -1,35 +0,0 @@ ------------------------------------------------------------------------------- --- ------------------ M a R T E O S ------------------- -- ------------------------------------------------------------------------------- --- {MARTE_VERSION} --- --- 'C o n t e x t' --- --- Spec --- --- File 'context.ads' By MAR --- --- Processor context for non-local jumps --- --- IMPORTANT: it must be compiled without any optimization!! --- --- {MARTE_COPYRIGHT} --- ------------------------------------------------------------------------------- --- {} ------------------------------------------------------------------- -package Context is - - type Work_Acc is access procedure; - pragma Convention (C, Work_Acc); - - function Execute_Work(Work : Work_Acc) return Integer; - pragma export(C,Execute_Work, "execute_work"); - - procedure Restore_Work; - pragma export(C,Restore_Work, "restore_work"); - -end Context; diff --git a/marte_non_local_jump/execute_context.h b/marte_non_local_jump/execute_context.h deleted file mode 100644 index 0948010..0000000 --- a/marte_non_local_jump/execute_context.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _EXECUTE_WORK -#define _EXECUTE_WORK - - -int execute_work (void (*func)()); - -void restore_work(); - -#endif // _EXECUTE_WORK diff --git a/marte_non_local_jump/non_local_jump_test.adb b/marte_non_local_jump/non_local_jump_test.adb deleted file mode 100644 index bde516c..0000000 --- a/marte_non_local_jump/non_local_jump_test.adb +++ /dev/null @@ -1,115 +0,0 @@ ------------------------------------------------------------------------------- --- ------------------ M a R T E O S ------------------- -- ------------------------------------------------------------------------------- --- {MARTE_VERSION} --- --- 'N o n _ L o c a l _ J u m p' --- --- Spec --- --- File 'non_local_jump.ads' By MAR --- --- Non-local jumps for preempted tasks. --- --- IMPORTANT: it must be compiled without any optimization!! --- --- {MARTE_COPYRIGHT} --- ------------------------------------------------------------------------------- --- {} ------------------------------------------------------------------- -pragma Task_Dispatching_Policy (FIFO_Within_Priorities); -with Text_IO; use Text_IO; -with Ada.Unchecked_Conversion; -with System; -with Marte.Integer_Types; use Marte.Integer_Types; -with Marte.HAL.Processor_Registers; -with Non_Local_Jump; -with System.Machine_Code; use System.Machine_Code; -with Execution_Load; - -procedure Non_Local_Jump_Test is - - --pragma Linker_Options("eat_20.o"); - - --procedure Eat_20; - --pragma Import (C, Eat_20, "eat_20"); - - pragma Priority (10); - - -- package PR renames Processor_Registers; - package PR renames Non_Local_Jump; - - Cont : Integer := 0; - pragma Volatile (Cont); - - TCB : System.Address := System.Null_Address; - pragma Volatile (TCB); - - function Pthread_Self return System.Address; - pragma Import (C, Pthread_Self, "pthread_self"); - - Jmp_Buff : aliased PR.Jmp_Context; - pragma Volatile (Jmp_Buff); - - procedure Por_Fastidiar2 (C : Integer) is - begin - loop - - Put_Line (Integer'Image (C)); - Execution_Load.Eat (20.0); - --for I in 1 .. 20_000_000 loop - -- null; - --end loop; - end loop; - end Por_Fastidiar2; - - procedure Por_Fastidiar1 (C : Integer) is - begin - Por_Fastidiar2 (C); - end Por_Fastidiar1; - - -- tarea q se cambia su dirección de retorno - task Saltarina is - pragma Priority (5); - end Saltarina; - - task body Saltarina is - begin - Put_Line ("hola2"); - TCB := Pthread_Self; - loop - PR.Save_Context(Jmp_Buff'Access); - -- Asm ("int $3", No_Output_Operands, No_Input_Operands, "", True); - if PR.After_Jump (Jmp_Buff'Access) = 1 then - Put_Line ("---After Jump---"); - else - Put_Line ("---Not After Jump 1---"); - Por_Fastidiar1 (Cont); - Put_Line ("---Not After Jump 2---"); - end if; - Cont := Cont + 1; - Put_Line(" Cont:" & Integer'Image (Cont)); - end loop; - - exception - when E:others => - Put_Line ("Exception in Saltarina"); - end Saltarina; - -begin - loop - delay 2.0; - exit when Cont >= 5; - - Put_Line ("Antes de cambiar retorno 3"); - PR.Restore_Context (TCB, Jmp_Buff'Access); - Put_Line ("Desp de cambiar retorno 3"); - --delay 1000000.0; - end loop; - Put_Line (Integer'Image (Jmp_Buff'Size/8)); - -end Non_Local_Jump_Test;