/demos/tags/rel_1_5_3/servo/makefile |
File deleted |
|
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/servo/load.c |
=================================================================== |
--- rel_1_5_3/servo/load.c (revision 1614) |
+++ rel_1_5_3/servo/load.c (nonexistent) |
@@ -1,76 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "drivers/shark_keyb26.h" |
-#include "unistd.h" |
- |
-#include "servo.h" |
- |
-#define N_SEND 10000 |
- |
-int main () { |
- |
- int res, i = 0, k; |
- |
- srand(sys_gettime(NULL)); |
- |
- cprintf("(Open Com2)"); |
- res = servo_open(COM2, 19200); |
- cprintf("(Res = %d)",res); |
- |
- cprintf("(Servo Turn On 0)"); |
- res = servo_turn_on(COM2, 0); |
- cprintf("(Res = %d)",res); |
- |
- while(i < N_SEND) { |
- |
- cprintf("(Cycle = %d)",i); |
- |
- k = rand() % 180 - 90; |
- |
- cprintf("(Set Servo 0 %d)",k); |
- res = servo_set_angle_sec(COM2, 0, ANGLE2SEC(k,0,0)); |
- cprintf("(Res = %d)",res); |
- |
- udelay(100000); |
- |
- i++; |
- |
- } |
- |
- servo_close(COM2); |
- |
- exit(0); |
- |
- return 0; |
- |
-} |
- |
Index: rel_1_5_3/servo/initfile.c |
=================================================================== |
--- rel_1_5_3/servo/initfile.c (revision 1614) |
+++ rel_1_5_3/servo/initfile.c (nonexistent) |
@@ -1,172 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * Authors: |
- * ... |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- /* Create the shutdown task. It will be activated at RUNLEVEL |
- SHUTDOWN */ |
- set_shutdown_task(); |
- |
- /* Init the drivers */ |
- device_drivers_init(); |
- |
- /* Set the shutdown task activation */ |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- /* WARNING: the shutdown task is a background thread. It cannot execute |
- if the system is overloaded */ |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- INPUT26_init(); |
- |
- //keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
/rel_1_5_3/servo/initfile.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/input/initkey.c |
=================================================================== |
--- rel_1_5_3/input/initkey.c (revision 1614) |
+++ rel_1_5_3/input/initkey.c (nonexistent) |
@@ -1,154 +0,0 @@ |
-/* |
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * Gerardo Lamastra <gerardo@sssup.it> |
- * |
- * Authors : |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
- |
-#include <kernel/kern.h> |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = 1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- return TICK; |
-} |
- |
-int device_drivers_close() { |
- |
- KEYB26_close(); |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_init() { |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- INPUT26_init(); |
- |
- /*keyb_def_map(kparms, KEYMAP_IT);*/ |
- keyb_def_ctrlC(kparms, NULL); |
- KEYB26_init(&kparms); |
- |
- return 0; |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- return NULL; |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-void call_shutdown_task(void *arg) { |
- |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
Index: rel_1_5_3/input/makefile |
=================================================================== |
--- rel_1_5_3/input/makefile (revision 1614) |
+++ rel_1_5_3/input/makefile (nonexistent) |
@@ -1,28 +0,0 @@ |
-# |
-# |
-# |
- |
-ifndef BASE |
-BASE=../.. |
-endif |
-include $(BASE)/config/config.mk |
- |
-PROGS= input speak key mouse joy |
- |
-include $(BASE)/config/example.mk |
- |
-input: |
- make -f $(SUBMAKE) APP=input INIT= OTHEROBJS="initfile.o" SHARKOPT="__INPUT__ __LINUXC26__ __PCI__ __FB__" |
- |
-speak: |
- make -f $(SUBMAKE) APP=speak INIT= OTHEROBJS="initspk.o" SHARKOPT="__INPUT__ __LINUXC26__ __PCI__" |
- |
-key: |
- make -f $(SUBMAKE) APP=key INIT= OTHEROBJS="initkey.o" SHARKOPT="__INPUT__ __LINUXC26__ __PCI__" |
- |
-mouse: |
- make -f $(SUBMAKE) APP=mouse INIT= OTHEROBJS="initcur.o" SHARKOPT="__INPUT__ __LINUXC26__ __PCI__" |
- |
-joy: |
- make -f $(SUBMAKE) APP=joy INIT= OTHEROBJS="initjoy.o" SHARKOPT="__INPUT__ __LINUXC26__ __PCI__" |
- |
Index: rel_1_5_3/input/initcur.c |
=================================================================== |
--- rel_1_5_3/input/initcur.c (revision 1614) |
+++ rel_1_5_3/input/initcur.c (nonexistent) |
@@ -1,164 +0,0 @@ |
-/* |
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * Gerardo Lamastra <gerardo@sssup.it> |
- * |
- * Authors : |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_mouse26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = 1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- return TICK; |
-} |
- |
-int device_drivers_close() { |
- |
- MOUSE26_close(); |
- KEYB26_close(); |
- INPUT26_close(); |
- |
- return 0; |
-} |
- |
-int device_drivers_init() { |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- MOUSE_PARMS mparms = BASE_MOUSE; |
- |
- LINUXC26_register_module(TRUE); |
- INPUT26_init(); |
- |
- /*keyb_def_map(kparms, KEYMAP_IT);*/ |
- keyb_def_ctrlC(kparms, NULL); |
- KEYB26_init(&kparms); |
- |
- MOUSE26_init(&mparms); |
- |
- return 0; |
- |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- return NULL; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) { |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
/rel_1_5_3/input/initcur.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/input/input.c |
=================================================================== |
--- rel_1_5_3/input/input.c (revision 1614) |
+++ rel_1_5_3/input/input.c (nonexistent) |
@@ -1,452 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni <mauro.marinoni@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <drivers/shark_fb26.h> |
- |
-#include <drivers/shark_mouse26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_spk26.h> |
-#include <drivers/shark_joy26.h> |
- |
-#define RGB_BLACK rgb16( 0, 0, 0) |
-#define RGB_GRAY rgb16(127,127,127) |
-#define RGB_WHITE rgb16(255,255,255) |
-#define RGB_RED rgb16(255, 0, 0) |
-#define RGB_GREEN rgb16( 0,255, 0) |
-#define RGB_BLUE rgb16( 0, 0,255) |
-#define RGB_YELLOW rgb16(255,255, 0) |
-#define RGB_MAGENTA rgb16(255, 0,255) |
-#define RGB_CYAN rgb16( 0,255,255) |
-#define RGB_D_RED rgb16(127, 0, 0) |
-#define RGB_D_GREEN rgb16( 0,127, 0) |
-#define RGB_D_BLUE rgb16( 0, 0,127) |
-#define RGB_D_YELLOW rgb16(127,127, 0) |
-#define RGB_D_MAGENTA rgb16(127, 0,127) |
-#define RGB_D_CYAN rgb16( 0,127,127) |
- |
-void my_sysend(KEY_EVT *e) |
-{ |
- exit(0); |
-} |
- |
-void no_note(KEY_EVT *e) |
-{ |
- speaker_sound(0, 0); |
-} |
- |
-void my_note(KEY_EVT *e) |
-{ |
- switch (e->scan) { |
- case KEY_Q: |
- speaker_sound(262, 0); /* DO */ |
- break; |
- case KEY_W: |
- speaker_sound(277, 0); /* DO# */ |
- break; |
- case KEY_E: |
- speaker_sound(294, 0); /* RE */ |
- break; |
- case KEY_R: |
- speaker_sound(311, 0); /* RE# */ |
- break; |
- case KEY_T: |
- speaker_sound(330, 0); /* MI */ |
- break; |
- case KEY_Y: |
- speaker_sound(349, 0); /* FA */ |
- break; |
- case KEY_U: |
- speaker_sound(370, 0); /* FA# */ |
- break; |
- case KEY_I: |
- speaker_sound(392, 0); /* SOL */ |
- break; |
- case KEY_O: |
- speaker_sound(415, 0); /* SOL# */ |
- break; |
- case KEY_P: |
- speaker_sound(440, 0); /* LA */ |
- break; |
- case KEY_BRL: |
- speaker_sound(466, 0); /* LA# */ |
- break; |
- case KEY_BRR: |
- speaker_sound(494, 0); /* SI */ |
- break; |
- } |
-} |
- |
-TASK my_getjoy(void *arg) |
-{ |
- int a0, a1, a2, a3, btn; |
- char st[20]; |
- |
- while (1) { |
- joy_getstatus(&a0, &a1, &a2, &a3, &btn); |
- |
- sprintf(st, "X Axis : %6d ", a0); |
- grx_text(st, 100, 64, RGB_CYAN, RGB_BLACK); |
- sprintf(st, "Y Axis : %6d ", a1); |
- grx_text(st, 100, 114, RGB_CYAN, RGB_BLACK); |
- sprintf(st, "Buttons: %2x ", btn); |
- grx_text(st, 100, 164, RGB_CYAN, RGB_BLACK); |
- |
- task_endcycle(); |
- if (btn == 0xF) |
- my_sysend(NULL); |
- } |
-} |
- |
-TASK my_getch(void *arg) |
-{ |
-#define MYNCHAR 25 |
- |
- BYTE ch; |
- int i = 0; |
- char st[20]; |
- |
- while (1) { |
- ch = keyb_getch(NON_BLOCK); |
- if (ch) { |
- if (ch == BACKSPACE) { //backspace |
- i--; |
- //ch = 0x20; |
- } |
- if (ch == ENTER) { //enter |
- i = ((i / MYNCHAR) + 1) * MYNCHAR - 1; |
- ch = 0x20; |
- } |
- sprintf(st, "%c", ch); |
- grx_text(st, 340 + 10 * (i%MYNCHAR), 25 + 20 * (i/MYNCHAR), RGB_BLUE, RGB_BLACK); |
- |
- if (ch == BACKSPACE) //backspace |
- i--; |
- if (++i >= MYNCHAR * 9) { |
- i = 0; |
- grx_box(315, 15, 623, 223, RGB_BLACK); |
- } |
- } |
- |
- task_endcycle(); |
- } |
-} |
- |
-void my_mouse(MOUSE_EVT *e) |
-{ |
- char st[20]; |
- char pressed = 0; |
- |
- sprintf(st, "X Axis : %3d (%4d)", e->x, e->dx); |
- grx_text(st, 100, 280, RGB_YELLOW, RGB_BLACK); |
- sprintf(st, "Y Axis : %3d (%4d)", e->y, e->dy); |
- grx_text(st, 100, 320, RGB_YELLOW, RGB_BLACK); |
- sprintf(st, "Z Axis : %3d (%4d)", e->z, e->dz); |
- grx_text(st, 100, 360, RGB_YELLOW, RGB_BLACK); |
- sprintf(st, "Buttons: %6x ", (int)e->buttons); |
- grx_text(st, 100, 400, RGB_YELLOW, RGB_BLACK); |
- |
- if ((e->x > 377) && (e->x < 401) && (e->y > 300) && (e->y < 360) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(277, 0); /* DO# */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 407) && (e->x < 431) && (e->y > 300) && (e->y < 360) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(311, 0); /* RE# */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 467) && (e->x < 491) && (e->y > 300) && (e->y < 360) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(370, 0); /* FA# */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 497) && (e->x < 521) && (e->y > 300) && (e->y < 360) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(415, 0); /* SOL# */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 527) && (e->x < 551) && (e->y > 300) && (e->y < 360) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(466, 0); /* LA# */ |
- pressed = 1; |
- } |
- return; |
- } |
- |
- if ((e->x > 360) && (e->x < 388) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)){ |
- if (!pressed) { |
- speaker_sound(262, 0); /* DO */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 390) && (e->x < 418) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(294, 0); /* RE */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 420) && (e->x < 448) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(330, 0); /* MI */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 450) && (e->x < 478) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(349, 0); /* FA */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 480) && (e->x < 508) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(392, 0); /* SOL */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 510) && (e->x < 538) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(440, 0); /* LA */ |
- pressed = 1; |
- } |
- return; |
- } |
- if ((e->x > 540) && (e->x < 568) && (e->y > 300) && (e->y < 400) && (e->buttons == MOUSE_LBUTTON)) { |
- if (!pressed) { |
- speaker_sound(494, 0); /* SI */ |
- pressed = 1; |
- } |
- return; |
- } |
- |
- speaker_sound(0, 0); |
- pressed = 0; |
-} |
- |
-void graph_init(void) |
-{ |
- grx_rect( 4, 4, 634, 474, RGB_WHITE); |
- grx_rect( 14, 14, 304, 224, RGB_YELLOW); |
- grx_rect(314, 14, 624, 224, RGB_RED); |
- grx_rect( 14, 234, 304, 464, RGB_GREEN); |
- grx_rect(314, 234, 624, 464, RGB_BLUE); |
- |
- /* Draw Teyboard */ |
- grx_box(360, 300, 388, 400, RGB_WHITE); /* DO */ |
- grx_box(390, 300, 418, 400, RGB_WHITE); /* RE */ |
- grx_box(420, 300, 448, 400, RGB_WHITE); /* MI */ |
- grx_box(450, 300, 478, 400, RGB_WHITE); /* FA */ |
- grx_box(480, 300, 508, 400, RGB_WHITE); /* SOL */ |
- grx_box(510, 300, 538, 400, RGB_WHITE); /* LA */ |
- grx_box(540, 300, 568, 400, RGB_WHITE); /* SI */ |
- |
- grx_box(377, 301, 401, 360, RGB_BLACK); /* DO# */ |
- grx_box(407, 301, 431, 360, RGB_BLACK); /* RE# */ |
- grx_box(467, 301, 491, 360, RGB_BLACK); /* FA# */ |
- grx_box(497, 301, 521, 360, RGB_BLACK); /* SOL# */ |
- grx_box(527, 301, 551, 360, RGB_BLACK); /* LA# */ |
-} |
- |
-void start_sound(void) |
-{ |
- KEY_EVT ev; |
- |
- speaker_sound(440, 400); |
- while ( (sys_gettime(NULL)/1000) < 1000); |
- |
- ev.ascii = 'q'; |
- ev.scan = KEY_Q; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'w'; |
- ev.scan = KEY_W; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'e'; |
- ev.scan = KEY_E; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'r'; |
- ev.scan = KEY_R; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 't'; |
- ev.scan = KEY_T; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'y'; |
- ev.scan = KEY_Y; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'u'; |
- ev.scan = KEY_U; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'i'; |
- ev.scan = KEY_I; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'o'; |
- ev.scan = KEY_O; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'p'; |
- ev.scan = KEY_P; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = '['; |
- ev.scan = KEY_BRL; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = ']'; |
- ev.scan = KEY_BRR; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- SOFT_TASK_MODEL mp; |
- PID pid; |
- |
- KEY_EVT ev; |
- |
- ev.ascii = 'c'; |
- ev.scan = KEY_C; |
- ev.status = KEY_PRESSED; |
- ev.flag = CNTL_BIT; |
- keyb_hook(ev, my_sysend, FALSE); |
- ev.flag = CNTR_BIT; |
- keyb_hook(ev, my_sysend, FALSE); |
- |
- graph_init(); |
- |
- mouse_grxlimits(639, 479); |
- mouse_setposition(319, 239, 0); |
- mouse_hook(my_mouse); |
- mouse_grxcursor(ENABLE, 2); |
- |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_met(mp,700); |
- soft_task_def_period(mp,10000); |
- soft_task_def_usemath(mp); |
- pid = task_create("Key_Print", my_getch, &mp, NULL); |
- if (pid == NIL) { |
- sys_shutdown_message("Could not create task <Key_Print>\n"); |
- exit(1); |
- } else |
- task_activate(pid); |
- |
- if (JOY26_installed()) { |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_met(mp,700); |
- soft_task_def_period(mp,10000); |
- soft_task_def_usemath(mp); |
- pid = task_create("Joy_Print", my_getjoy, &mp, NULL); |
- if (pid == NIL) { |
- sys_shutdown_message("Could not create task <Joy_Print>\n"); |
- exit(1); |
- } else |
- task_activate(pid); |
- } |
- |
- start_sound(); |
- return 0; |
-} |
Index: rel_1_5_3/input/initspk.c |
=================================================================== |
--- rel_1_5_3/input/initspk.c (revision 1614) |
+++ rel_1_5_3/input/initspk.c (nonexistent) |
@@ -1,156 +0,0 @@ |
-/* |
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * Gerardo Lamastra <gerardo@sssup.it> |
- * |
- * Authors : |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
- |
-#include <kernel/kern.h> |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_spk26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-PID shutdown_task_PID = 1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- return TICK; |
-} |
- |
-int device_drivers_close() { |
- |
- KEYB26_close(); |
- SPEAK26_close(); |
- INPUT26_close(); |
- |
- return 0; |
-} |
- |
-int device_drivers_init() { |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- INPUT26_init(); |
- |
- /*keyb_def_map(kparms, KEYMAP_IT);*/ |
- keyb_def_ctrlC(kparms, NULL); |
- KEYB26_init(&kparms); |
- |
- SPEAK26_init(); |
- return 0; |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- return NULL; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) { |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
Index: rel_1_5_3/input/joy.c |
=================================================================== |
--- rel_1_5_3/input/joy.c (revision 1614) |
+++ rel_1_5_3/input/joy.c (nonexistent) |
@@ -1,76 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni <mauro.marinoni@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <drivers/shark_joy26.h> |
- |
-TASK my_getjoy(void *arg) { |
- |
- int a0, a1, a2, a3, btn; |
- |
- while (1) { |
- joy_getstatus(&a0, &a1, &a2, &a3, &btn); |
- cprintf("(%6d %6d) %2x\n", a0, a1, btn); |
- task_endcycle(); |
- if (btn == 0xF) |
- exit(1); |
- } |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- SOFT_TASK_MODEL mp; |
- PID pid; |
- |
- if (!JOY26_installed()) { |
- cprintf("No Joystick found."); |
- exit(1); |
- } |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_met(mp,700); |
- soft_task_def_period(mp,10000); |
- soft_task_def_usemath(mp); |
- pid = task_create("Joy_Print", my_getjoy, &mp, NULL); |
- if (pid == NIL) { |
- sys_shutdown_message("Could not create task <Joy_Print>\n"); |
- exit(1); |
- } else |
- task_activate(pid); |
- |
- return 0; |
-} |
/rel_1_5_3/input/joy.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/input/speak.c |
=================================================================== |
--- rel_1_5_3/input/speak.c (revision 1614) |
+++ rel_1_5_3/input/speak.c (nonexistent) |
@@ -1,208 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni <mauro.marinoni@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_spk26.h> |
- |
-void my_sysclose(KEY_EVT *e) |
-{ |
- speaker_sound(0, 0); |
- |
- kern_printf("S.Ha.R.K. closed.\n\n"); |
- exit(0); |
-} |
- |
-void no_note(KEY_EVT *e){ |
- speaker_sound(0, 0); |
-} |
- |
-void my_note(KEY_EVT *e){ |
- |
- switch (e->scan) { |
- case KEY_Q: |
- speaker_sound(262, 0); |
- break; |
- case KEY_W: |
- speaker_sound(277, 0); |
- break; |
- case KEY_E: |
- speaker_sound(294, 0); |
- break; |
- case KEY_R: |
- speaker_sound(311, 0); |
- break; |
- case KEY_T: |
- speaker_sound(330, 0); |
- break; |
- case KEY_Y: |
- speaker_sound(349, 0); |
- break; |
- case KEY_U: |
- speaker_sound(370, 0); |
- break; |
- case KEY_I: |
- speaker_sound(392, 0); |
- break; |
- case KEY_O: |
- speaker_sound(415, 0); |
- break; |
- case KEY_P: |
- speaker_sound(440, 0); |
- break; |
- case KEY_BRL: |
- speaker_sound(466, 0); |
- break; |
- case KEY_BRR: |
- speaker_sound(494, 0); |
- break; |
- } |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- KEY_EVT ev; |
- |
- ev.ascii = 'c'; |
- ev.scan = KEY_C; |
- ev.status = KEY_PRESSED; |
- ev.flag = CNTL_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- ev.flag = CNTR_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- |
- speaker_sound(440, 400); |
- while ( (sys_gettime(NULL)/1000) < 1000); |
- |
- ev.ascii = 'q'; |
- ev.scan = KEY_Q; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'w'; |
- ev.scan = KEY_W; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'e'; |
- ev.scan = KEY_E; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'r'; |
- ev.scan = KEY_R; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 't'; |
- ev.scan = KEY_T; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'y'; |
- ev.scan = KEY_Y; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'u'; |
- ev.scan = KEY_U; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'i'; |
- ev.scan = KEY_I; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'o'; |
- ev.scan = KEY_O; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = 'p'; |
- ev.scan = KEY_P; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = '['; |
- ev.scan = KEY_BRL; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- ev.ascii = ']'; |
- ev.scan = KEY_BRR; |
- ev.flag = 0; |
- ev.status = KEY_PRESSED; |
- keyb_hook(ev, my_note, FALSE); |
- ev.status = KEY_RELEASED; |
- keyb_hook(ev, no_note, FALSE); |
- |
- while(1); |
- return 0; |
-} |
Index: rel_1_5_3/input/initfile.c |
=================================================================== |
--- rel_1_5_3/input/initfile.c (revision 1614) |
+++ rel_1_5_3/input/initfile.c (nonexistent) |
@@ -1,217 +0,0 @@ |
-/* |
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * Gerardo Lamastra <gerardo@sssup.it> |
- * |
- * Authors : |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * Copyright (C) 2000 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
- |
-#include "kernel/kern.h" |
- |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "hardcbs/hardcbs/hardcbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
- |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_mouse26.h> |
-#include <drivers/shark_spk26.h> |
-#include <drivers/shark_joy26.h> |
- |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 2000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- HCBS_register_level(HCBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- CABS_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- /* Create the shutdown task. It will be activated at RUNLEVEL SHUTDOWN */ |
- set_shutdown_task(); |
- |
- /* Init the drivers */ |
- device_drivers_init(); |
- |
- /* Set the shutdown task activation */ |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() |
-{ |
-/* WARNING: the shutdown task is a background thread. It cannot execute if the system is overloaded */ |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
-} |
- |
-int device_drivers_init() |
-{ |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- MOUSE_PARMS mparms = BASE_MOUSE; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- /* keyb_def_map(kparms, KEYMAP_IT);*/ |
- keyb_def_ctrlC(kparms, NULL); |
- KEYB26_init(&kparms); |
- |
- mouse_def_threshold(mparms, 5); |
- mouse_def_xmin(mparms, 0); |
- mouse_def_ymin(mparms, 0); |
- mouse_def_xmax(mparms, 639); |
- mouse_def_ymax(mparms, 479); |
- MOUSE26_init(&mparms); |
- |
- SPEAK26_init(); |
- |
- JOY26_init(); |
- |
- FB26_init(); |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- MOUSE26_close(); |
- SPEAK26_close(); |
- JOY26_close(); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
-} |
- |
-int device_drivers_close() { |
- |
- mouse_grxcursor(DISABLE, 0); |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- MOUSE26_close(); |
- SPEAK26_close(); |
- JOY26_close(); |
- KEYB26_close(); |
- INPUT26_close(); |
- |
- return 0; |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) |
-{ |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
-} |
Index: rel_1_5_3/input/initjoy.c |
=================================================================== |
--- rel_1_5_3/input/initjoy.c (revision 1614) |
+++ rel_1_5_3/input/initjoy.c (nonexistent) |
@@ -1,149 +0,0 @@ |
-/* |
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * Gerardo Lamastra <gerardo@sssup.it> |
- * |
- * Authors: |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_joy26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-PID shutdown_task_PID = 1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- return TICK; |
-} |
- |
-int device_drivers_close() { |
- |
- JOY26_close(); |
- INPUT26_close(); |
- |
- return 0; |
-} |
- |
-int device_drivers_init() { |
- |
- LINUXC26_register_module(TRUE); |
- INPUT26_init(); |
- |
- JOY26_init(); |
- |
- return 0; |
- |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- return NULL; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) { |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
/rel_1_5_3/input/initjoy.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/input/key.c |
=================================================================== |
--- rel_1_5_3/input/key.c (revision 1614) |
+++ rel_1_5_3/input/key.c (nonexistent) |
@@ -1,135 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni <mauro.marinoni@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <drivers/shark_keyb26.h> |
- |
-//#define SHOW_EVT |
- |
-void my_sysclose(KEY_EVT *e) |
-{ |
- kern_printf("S.Ha.R.K. closed.\n\n"); |
- exit(0); |
-} |
- |
-TASK my_get(void *arg) { |
-#ifdef SHOW_EVT |
- int status; |
- KEY_EVT ev; |
-#else |
- BYTE ch; |
-#endif |
- |
- while (1) { |
-#ifdef SHOW_EVT |
- status = keyb_getcode(&ev, NON_BLOCK); |
- if (status == TRUE) |
- cprintf("[%c %d %d %d]\n", ev.ascii, ev.scan, ev.status, ev.flag); |
-#else |
- ch = keyb_getch(NON_BLOCK); |
- if (ch) |
- cprintf("%c", ch); |
-#endif |
- task_endcycle(); |
- } |
-} |
- |
-void my_pause(KEY_EVT *e){ |
- |
- TIME t; |
- |
- cprintf("Start Pause.\n"); |
- keyb_disable(); |
- cprintf("Keyboard Disabled.\n"); |
- t = sys_gettime(NULL); |
- while ( ( (sys_gettime(NULL) -t) / 1000) < 5000); |
- keyb_enable(); |
- cprintf("Keyboard Enabled.\n"); |
-} |
- |
-void my_test(KEY_EVT *e){ |
- cprintf("<test>\n"); |
-} |
- |
-void my_arrow(KEY_EVT *e){ |
- cprintf("<arrow>\n"); |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- SOFT_TASK_MODEL mp; |
- PID pid; |
- |
- KEY_EVT ev; |
- |
- ev.ascii = 'p'; |
- ev.scan = KEY_P; |
- ev.status = KEY_PRESSED; |
- ev.flag = CNTR_BIT; |
- keyb_hook(ev, my_pause, FALSE); |
- |
- set_keyevt(&ev, 'a', KEY_A, 0, KEY_PRESSED|KEY_REPEATED); |
- keyb_hook(ev, my_test, FALSE); |
- |
- set_keyevt(&ev, 0, EXT_UP, 0, KEY_PRESSED); |
- keyb_hook(ev, my_arrow, FALSE); |
- |
- set_keyevt(&ev, 'b', KEY_B, CNTL_BIT, KEY_PRESSED); |
- keyb_hook(ev, my_test, TRUE); |
- |
- ev.ascii = 'c'; |
- ev.scan = KEY_C; |
- ev.status = KEY_PRESSED; |
- ev.flag = CNTR_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- ev.flag = CNTL_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_met(mp,700); |
- soft_task_def_period(mp,1000); |
- soft_task_def_usemath(mp); |
- pid = task_create("Keyb_Print", my_get, &mp, NULL); |
- if (pid == NIL) { |
- perror("Could not create task <Keyb_Print>"); |
- exit(1); |
- } else |
- task_activate(pid); |
- |
- return 0; |
-} |
Index: rel_1_5_3/input/mouse.c |
=================================================================== |
--- rel_1_5_3/input/mouse.c (revision 1614) |
+++ rel_1_5_3/input/mouse.c (nonexistent) |
@@ -1,95 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni <mauro.marinoni@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include <kernel/kern.h> |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <drivers/shark_mouse26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_spk26.h> |
- |
-void my_sysclose(KEY_EVT *e) |
-{ |
- mouse_txtcursor(DISABLE); |
- |
- exit(0); |
-} |
- |
-TASK my_putxy(void *arg) { |
- |
- int x, y, z; |
- unsigned long btn; |
- |
- clear(); |
- |
- while (1) { |
- mouse_getposition(&x, &y, &z, &btn); |
- place(10, 10); |
- cprintf("X: %2d - Y: %2d - Z: %3d - Btn: %4d\n", x, y, z, (int)btn); |
- |
- task_endcycle(); |
- } |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- SOFT_TASK_MODEL mp; |
- PID pid; |
- KEY_EVT ev; |
- |
- ev.ascii = 'c'; |
- ev.scan = KEY_C; |
- ev.status = KEY_PRESSED; |
- ev.flag = CNTL_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- ev.flag = CNTR_BIT; |
- keyb_hook(ev, my_sysclose, FALSE); |
- |
- mouse_txtcursor(ENABLE); |
- |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_met(mp,700); |
- soft_task_def_period(mp,1000); |
- soft_task_def_usemath(mp); |
- pid = task_create("Mouse_Print", my_putxy, &mp, NULL); |
- if (pid == NIL) { |
- sys_shutdown_message("Could not create task <Mouse_Print>\n"); |
- my_sysclose(NULL); |
- } else |
- task_activate(pid); |
- |
- return 0; |
-} |
/rel_1_5_3/input/mouse.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/dynademo/readme.txt |
=================================================================== |
--- rel_1_5_3/dynademo/readme.txt (revision 1614) |
+++ rel_1_5_3/dynademo/readme.txt (nonexistent) |
@@ -1,83 +0,0 @@ |
---------------------------------------------- |
-Dynalink Demo. |
---------------------------------------------- |
-This is the Dynalink for S.H.A.R.K demo. |
-Source files are in /shark/projects/dynademo |
-The SHARK kernel and the user application |
-are compiled seperatly by; |
- |
-make_os.mk |
-make_app.mk |
- |
-The resulting OS kernel file is a default |
-SHARK mutliboot compliant ELF executable. |
-The resluting user Application is an ELF object file. |
- |
-Also included is a small test data.bin file |
-to illustrate the use of extra data module parsing through GRUB. |
- |
-The idea is to boot the SHARK kernel through GRUB, |
-and parsing the User Application plus any needed |
-data files as 'boot modules'. |
-GRUB usage example: |
- |
-# For booting SHARK image from HD |
-title S.H.A.R.K + Boot Modules from HD 0,0 |
-kernel (hd0,0)/boot/os mount root=/dev/hda1 |
-module (hd0,0)/boot/sh_app.bin |
-module (hd0,0)/boot/data.bin |
- |
-This could be a possible solution to get by |
-certain GPL restrictions since no GPL code |
-resides in the user application. |
-The user application is dynamicly linked |
-after the kernel is loaded. |
- |
-Another advantage is that we have a simple |
-way of loading data files without the need for |
-an IDE-driver plus Filesystem. |
-Good enough for a few embedded solutions. |
- |
-------------------------------------------------------------- |
-Dynalink code |
-------------------------------------------------------------- |
-The Dynalinker is based on Luca Abenia's code |
-as used in the FD32 project. |
-Source files are in /shark/dynalink |
-The Dynalink makefile produces libdynalink.a |
-which is compiled into the kernel by adding SHARKOPT =" __DYNALINK__" |
- |
-Also not that I added a section to config.mk as |
-you can see in the included config.mk |
- |
-# added for dynalink [lex] |
-ifndef DYNALINK |
-LINK_OPT = -Bstatic -Ttext $(MEM_START) -s -nostartfiles -nostdlib -L$(LIB_PATH) -L$(OSLIB_PATH) |
-else |
-LINK_OPT = -Bstatic |
-endif |
- |
-Operation: |
-The Dynalinker supports only ELF objects. |
-Everything else is loaded and treated as Data objects. |
- |
-After the SHARK kernel is booted it will execute main() |
-which sole purpose here is to process all parsed |
-boot modules, link any valid ELF objects |
-and put the results in a dynalink_module_list struct. |
-This struct is then used to run the actual User Application |
-and to hold info about possible data files in memory |
-that the User Application can use. |
- |
-The dynalinker uses a syscall_table to export/import the symbols. |
-(review dynalink.c) |
-Not all SHARK/Library functions needs to be exported! |
-This is of course just an example. |
- |
- |
-/Lex Nahumury 5:41 19-7-06 |
- |
- |
- |
- |
- |
Index: rel_1_5_3/dynademo/data.bin |
=================================================================== |
--- rel_1_5_3/dynademo/data.bin (revision 1614) |
+++ rel_1_5_3/dynademo/data.bin (nonexistent) |
@@ -1,11 +0,0 @@ |
-////////////////////////////////////////////////////////////////////// |
-/////////////// User Application running ///////////////////////////// |
- |
-Dynalink demo. |
- |
-An ELF object (which is running now) and a data file |
-(which you read now) are parsed as 'boot modules' |
-to the S.H.A.R.K kernel by GRUB. |
- |
-Press a key to continue with this lame application.....:) |
-////////////////////////////////////////////////////////////////////// |
\ No newline at end of file |
Index: rel_1_5_3/dynademo/app.c |
=================================================================== |
--- rel_1_5_3/dynademo/app.c (revision 1614) |
+++ rel_1_5_3/dynademo/app.c (nonexistent) |
@@ -1,188 +0,0 @@ |
-/////////////////////////////////////////////////// |
-// app.c -Lex Nahumury 2006 |
-// |
-// This would be the Closed Source User Application part. |
-// The ELF object itself contains no GPL code. |
-// The references to GPL code are resolved |
-// by the Dynamic Linker after the kernel has loaded. |
-// |
-////////////////////////////////////////////////// |
- |
-/* |
-Usage example: |
- |
-# For booting SHARK image from HD |
-title S.H.A.R.K + Boot Modules from HD 0,0 |
-kernel (hd0,0)/boot/os mount root=/dev/hda1 |
-module (hd0,0)/boot/sh_app.bin |
-module (hd0,0)/boot/data.bin |
- |
-*/ |
- |
-#include "kernel/kern.h" |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <stdio.h> |
-#include <string.h> |
-#include <math.h> |
-#include "ll/i386/cons.h" |
- |
-#include <drivers/shark_keyb26.h> |
-#include "../../ports/dynalink/dynalink.h" |
- |
-extern void call_shutdown_task(void *arg); |
-extern DWORD get_tick(); |
- |
-struct params |
-{ |
- int task_nr; |
- int row; |
- int count; |
- int cycles; |
-}; |
- |
- |
-TASK periodic_task(void *arg) |
-{ |
- int ani=0; |
- char c[2]; |
- struct params* p = (struct params*)(arg); |
- int row = p->row; |
- char txt[4]; |
- p->count=0; |
- |
- while(p->count < p->cycles) |
- { |
- switch(ani) |
- { |
- case 0: |
- ani=1; sprintf(c,"%s", "\\"); |
- break; |
- case 1: |
- ani=2; sprintf(c,"/"); |
- break; |
- case 2: |
- ani=0; sprintf(c,"-"); |
- break; |
- } |
- puts_xy(12,row,YELLOW, c ); |
- |
- ++p->count; |
- sprintf(txt,"%02d", p->count); |
- puts_xy(8,row,YELLOW, txt); |
- |
- task_endcycle(); |
- } |
- |
- cprintf("Task #%d end.\n", p->task_nr); |
- if(p->task_nr==4) call_shutdown_task(0); |
- return 0; |
-}; |
- |
- |
-// This is the main user application entry point. |
-int main_module_entry(void* arg) |
-{ |
- struct dynalink_module_list* dml = (struct dynalink_module_list*)arg; |
- |
- // make char pointer to text data module,.. |
- char* txt = (char*)(dml->dat[0].start); |
- |
- // ... and print out it's data content |
- cprintf("%s", txt); |
- |
- keyb_getch(BLOCK); |
- clear(); |
- |
- SOFT_TASK_MODEL msoft; |
- PID p1,p2,p3,p4; |
- |
- int yrow = 1; |
- puts_xy(0,yrow, 7,"Task#1:[ ]"); |
- puts_xy(0,yrow+1,7,"Task#2:[ ]"); |
- puts_xy(0,yrow+2,7,"Task#3:[ ]"); |
- puts_xy(0,yrow+3,7,"Task#4:[ ]"); |
- |
- place(0,7); |
- |
- // Init shared soft task model |
- soft_task_default_model(msoft); |
- soft_task_def_met(msoft,10000); |
- soft_task_def_group(msoft, 1); |
- soft_task_def_periodic(msoft); |
- soft_task_def_level(msoft, 2); |
- |
- int cycles = 4; |
- |
- // init Task 1 |
- float task_periode = 1.0; // 1sec |
- int tick = get_tick(); // 1000 usec = 1 ms |
- int per = (int)( task_periode *1000.0 * tick); |
- struct params pp1; |
- pp1.task_nr = 1; |
- pp1.row = yrow; |
- pp1.cycles = cycles; |
- soft_task_def_period(msoft, per); // set period |
- soft_task_def_arg(msoft, (void*)(&pp1) ); // set arguments |
- p1 = task_create("save", periodic_task, &msoft, NULL); |
- if (p1 == NIL) |
- { |
- sys_shutdown_message("Can't create task1 ...\n"); |
- exit(1); |
- } |
- |
- // init Task 2 |
- task_periode = task_periode*0.5; // twice as fast as task1 |
- tick = get_tick(); // 1000 usec = 1 ms |
- per = (int)( task_periode *1000.0 * tick); |
- struct params pp2; |
- pp2.task_nr = 2; |
- pp2.row = yrow+1; |
- pp2.cycles = cycles*2; |
- soft_task_def_period(msoft, per); |
- soft_task_def_arg(msoft, (void*)(&pp2) ); |
- p2 = task_create("skip", periodic_task, &msoft, NULL); |
- if (p2 == NIL) |
- { |
- sys_shutdown_message("Can't create task2...\n"); |
- exit(1); |
- } |
- |
- // init Task 3 |
- task_periode = task_periode*0.5; // twice as fast as previous task |
- tick = get_tick(); // 1000 usec = 1 ms |
- per = (int)( task_periode *1000.0 * tick); |
- struct params pp3; |
- pp3.task_nr = 3; |
- pp3.row = yrow+2; |
- pp3.cycles = cycles*4; |
- soft_task_def_period(msoft, per); |
- soft_task_def_arg(msoft, (void*)(&pp3) ); |
- p3 = task_create("skip", periodic_task, &msoft, NULL); |
- if(p3 == NIL) |
- { |
- sys_shutdown_message("Can't create task3...\n"); |
- exit(1); |
- } |
- |
- // init Task 4 |
- task_periode = task_periode*0.5; // twice as fast as previous task |
- tick = get_tick(); // 1000 usec = 1 ms |
- per = (int)( task_periode *1000.0 * tick); |
- struct params pp4; |
- pp4.task_nr = 4; |
- pp4.row = yrow+3; |
- pp4.cycles = cycles*8; |
- soft_task_def_period(msoft, per); |
- soft_task_def_arg(msoft, (void*)(&pp4) ); |
- p4 = task_create("skip", periodic_task, &msoft, NULL); |
- if(p4 == NIL) |
- { |
- sys_shutdown_message("Can't create task4...\n"); |
- exit(1); |
- } |
- |
- group_activate(1); |
- |
- return 0; |
-}; |
Index: rel_1_5_3/dynademo/os.c |
=================================================================== |
--- rel_1_5_3/dynademo/os.c (revision 1614) |
+++ rel_1_5_3/dynademo/os.c (nonexistent) |
@@ -1,201 +0,0 @@ |
-////////////////////////////////////////////////////////////// |
-// os.c -Lex Nahumury 2006 |
-// |
-// This is the OpenSource SHARK OS/kernel part. |
-// It will dynamicly link the main application ELF object |
-// through 'Dynalink'. |
-// |
-////////////////////////////////////////////////////////////// |
-#include "kernel/kern.h" |
-#include <kernel/func.h> |
-#include <stdlib.h> |
-#include <stdio.h> |
-#include <string.h> |
-#include <math.h> |
-#include "ll/i386/cons.h" |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "hardcbs/hardcbs/hardcbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-// DYNALINK |
-#include <dynalink.h> |
- |
-// some shark pci forward declaration stuff |
-extern int pci20to26_find_class(unsigned int class_code, int index, BYTE *bus, BYTE *dev); |
-extern int pci20to26_read_config_byte(unsigned int bus, unsigned int dev, int where, BYTE *val); |
-extern int pci20to26_read_config_word(unsigned int bus, unsigned int dev, int where, WORD *val); |
-extern int pci20to26_read_config_dword(unsigned int bus, unsigned int dev, int where, DWORD *val); |
-extern int pci20to26_write_config_byte(unsigned int bus, unsigned int dev, int where, BYTE val); |
-extern int pci20to26_write_config_word(unsigned int bus, unsigned int dev, int where, WORD val); |
-extern int pci20to26_write_config_dword(unsigned int bus, unsigned int dev, int where, DWORD val); |
- |
- |
-#define TICK 1000 // 1ms |
-#define RRTICK 100000 // 100ms |
- |
-/*+ IntDrive Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-#define NSEC_PER_SEC (1000000000L) |
-#define SHUTDOWN_TIMEOUT_SEC 0.5 // seconds |
- |
-// prototypes |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-// user application function pointer prototype |
-int (*main_app_entry)(void* arg); |
- |
- |
-// vars |
-static struct multiboot_info *mb = 0; |
-static struct dynalink_module_list dml; |
-PID shutdown_task_PID = -1; |
- |
- |
-// user app calls this to retrieve tick |
-DWORD get_tick() |
-{ |
- return TICK; |
-}; |
- |
-TASK shutdown_task_body(void *arg) |
-{ |
- device_drivers_close(); |
- sys_shutdown_message("-- OS Closed --\n"); |
- return NULL; |
-}; |
- |
-void set_shutdown_task() |
-{ |
- NRT_TASK_MODEL nrt; |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) |
- { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
-}; |
- |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- sys_gettime(&t); |
- t.tv_nsec += NSEC_PER_SEC * SHUTDOWN_TIMEOUT_SEC; |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- task_activate(shutdown_task_PID); |
-}; |
- |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- CABS_register_module(); |
- |
- return TICK; |
-}; |
- |
-TASK __init__(void *arg) |
-{ |
- mb = (struct multiboot_info *)arg; |
- |
- //HARTPORT_init(); |
- set_shutdown_task(); |
- device_drivers_init(); |
- |
- sys_atrunlevel( call_shutdown_task, |
- NULL, |
- RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-}; |
- |
- |
-int main(int argc, char **argv) |
-{ |
- // Any modules passed to kernel by GRUB? |
- if(!mb->mods_count) |
- { |
- printk("No modules passed at all! Bye..\n"); |
- exit(1); |
- } |
- |
- // Process the modules through 'dynalink' |
- dynalink_modules(mb, &dml, "_module_entry"); |
- if(dml.num_apps == 0) |
- { |
- printk("No Application modules found! Bye..\n"); |
- exit(1); |
- } |
- |
- // Run first found user application function |
- // and pass the dynalink_module_list.. |
- DWORD dynadr = dml.app[0].dyn_entry; |
- if(dynadr) |
- { |
- main_app_entry = (void*)dynadr; |
- main_app_entry(&dml); |
- } |
- else |
- { |
- printk("No Application modules found! Bye..\n"); |
- exit(1); |
- } |
-return 0; |
-}; |
- |
- |
-int device_drivers_init() |
-{ |
- LINUXC26_register_module(TRUE); |
- //PCI26_init(); |
- INPUT26_init(); |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- keyb_def_ctrlC(kparms, NULL); |
- KEYB26_init(&kparms); |
- |
- return 0; |
-}; |
- |
-int device_drivers_close() |
-{ |
- KEYB26_close(); |
- INPUT26_close(); |
- return 0; |
-}; |
- |
- |
Index: rel_1_5_3/dynademo/make_app.mk |
=================================================================== |
--- rel_1_5_3/dynademo/make_app.mk (revision 1614) |
+++ rel_1_5_3/dynademo/make_app.mk (nonexistent) |
@@ -1,35 +0,0 @@ |
-# This will make one single object file from multiple sources [Lex.N] |
- |
-DYNALINK=1 |
-ifndef BASE |
-BASE=../.. |
-endif |
- |
-include $(BASE)/config/config.mk |
- |
-OTHERINCL += -I$(BASE)/drivers/linuxc26/include -I./include -I. |
-OTHERINCL += -I$(BASE)/drivers/pci/include |
-OTHERINCL += -I$(BASE)/drivers/input/include |
- |
-# add all sources here.. |
-OBJS = app.o |
- |
-all: sh_app.o |
- $(MV) sh_app.o sh_app.bin |
- |
- |
-clean : |
- $(RM) *.o |
- |
-sh_app.o: $(OBJS) |
- $(LD) $(LINK_OPT) $(OBJS) -r -s -o sh_app.o |
- |
- |
-# Common rules |
-%.o : %.c |
- $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -c $< |
-%.s : %.c |
- $(REDIR) $(CC) $(C_OPT) $(C_OUTPUT) -S $< |
-%.o : %.s |
- $(CC) $(ASM_OPT) -c $< |
- |
Index: rel_1_5_3/dynademo/make_os.mk |
=================================================================== |
--- rel_1_5_3/dynademo/make_os.mk (revision 1614) |
+++ rel_1_5_3/dynademo/make_os.mk (nonexistent) |
@@ -1,19 +0,0 @@ |
-# |
- |
-ifndef BASE |
-BASE=../.. |
-endif |
- |
-PROGS = os |
- |
-include $(BASE)/config/config.mk |
-include $(BASE)/config/example.mk |
- |
-$(PROGS): |
- make -f $(SUBMAKE) APP=$(PROGS) \ |
- INIT= \ |
- OTHEROBJS= \ |
- OTHERINCL= \ |
- SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __DYNALINK__" |
- |
- |
Index: rel_1_5_3/cpufreq/makefile |
=================================================================== |
--- rel_1_5_3/cpufreq/makefile (revision 1614) |
+++ rel_1_5_3/cpufreq/makefile (nonexistent) |
@@ -1,16 +0,0 @@ |
-# |
-# |
-# |
- |
-ifndef BASE |
-BASE=../.. |
-endif |
-include $(BASE)/config/config.mk |
- |
-PROGS= cpufreq |
- |
-include $(BASE)/config/example.mk |
- |
-cpufreq: |
- make -f $(SUBMAKE) APP=cpufreq INIT= OTHEROBJS="initfile.o" SHARKOPT="__INPUT__ __CPU__ __LINUXC26__ __PCI__" |
- |
Index: rel_1_5_3/cpufreq/initfile.c |
=================================================================== |
--- rel_1_5_3/cpufreq/initfile.c (revision 1614) |
+++ rel_1_5_3/cpufreq/initfile.c (nonexistent) |
@@ -1,186 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "hardcbs/hardcbs/hardcbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include "drivers/shark_linuxc26.h" |
-#include "drivers/shark_input26.h" |
-#include "drivers/shark_keyb26.h" |
- |
-#include <drivers/shark_cpu26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ IntDrive Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- HCBS_register_level(HCBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- CABS_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- /* Create the shutdown task. It will be activated at RUNLEVEL |
- SHUTDOWN */ |
- set_shutdown_task(); |
- |
- /* Init the drivers */ |
- device_drivers_init(); |
- |
- /* Set the shutdown task activation */ |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- //sys_set_reboot(EXIT_MODE_HALT); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- /* WARNING: the shutdown task is a background thread. It cannot execute |
- if the system is overloaded */ |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- CPU26_init(); |
- |
- CPU26_DVS_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- //CPU26_DVS_close(); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
Index: rel_1_5_3/cpufreq/cpufreq.c |
=================================================================== |
--- rel_1_5_3/cpufreq/cpufreq.c (revision 1614) |
+++ rel_1_5_3/cpufreq/cpufreq.c (nonexistent) |
@@ -1,75 +0,0 @@ |
- |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : Mauro Marinoni |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <kernel/kern.h> |
- |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_cpu26.h> |
- |
-void endfunc(KEY_EVT *e) |
-{ |
- exit(0); |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- int val, num; |
- char buf[1000]; |
- |
- CPU26_showinfo(); |
- |
- val = CPU26_get_min_frequency(); |
- cprintf("Min freq: %d\n", val); |
- |
- val = CPU26_get_max_frequency(); |
- cprintf("Max freq: %d\n", val); |
- |
- val = CPU26_get_cur_frequency(); |
- cprintf("Current freq: %d\n", val); |
- |
- num = CPU26_show_frequencies(buf); |
- if (num>0) |
- cprintf("Allowed frequencys: %s\n", buf); |
- num = CPU26_get_frequencies(cpu26_freqs); |
- |
- if (num>0) { |
- CPU26_set_frequency(cpu26_freqs[0], DVS_RELATION_L); |
- val = CPU26_get_cur_frequency(); |
- cprintf("Actual freq: %d\n", val); |
- } |
- |
- endfunc(NULL); |
- |
- return 0; |
-} |
/rel_1_5_3/cpufreq/cpufreq.c |
Property changes: |
Deleted: svn:executable |
## -1 +0,0 ## |
-* |
\ No newline at end of property |
Index: rel_1_5_3/mesatex/initfile.c |
=================================================================== |
--- rel_1_5_3/mesatex/initfile.c (revision 1614) |
+++ rel_1_5_3/mesatex/initfile.c (nonexistent) |
@@ -1,202 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "hardcbs/hardcbs/hardcbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- HCBS_register_level(HCBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- CABS_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- /* Create the shutdown task. It will be activated at RUNLEVEL |
- SHUTDOWN */ |
- set_shutdown_task(); |
- |
- /* Init the drivers */ |
- device_drivers_init(); |
- |
- /* Set the shutdown task activation */ |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- /* WARNING: the shutdown task is a background thread. It cannot execute |
- if the system is overloaded */ |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- FB26_init(); |
- |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
- |
Index: rel_1_5_3/mesatex/mesatex.c |
=================================================================== |
--- rel_1_5_3/mesatex/mesatex.c (revision 1614) |
+++ rel_1_5_3/mesatex/mesatex.c (nonexistent) |
@@ -1,391 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <GL/osmesa.h> |
-#include <GL/glut.h> |
- |
-#include <math.h> |
-#include <stdlib.h> |
-#include <assert.h> |
-#include <kernel/log.h> |
-#include <kernel/kern.h> |
- |
-#include <drivers/shark_fb26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-#ifndef M_PI |
-#define M_PI 3.14159265 |
-#endif |
- |
-#define WIDTH 640 |
-#define HEIGHT 430 |
-#define BYTES_PP 2 //BytesPerPixel |
- |
-OSMesaContext ctx; |
- |
-static GLuint TexObj[2]; |
-static GLfloat Angle = 0.0f; |
-static GLboolean UseObj = GL_FALSE; |
- |
-extern void *video_memory; |
- |
-#if defined(GL_VERSION_1_1) || defined(GL_VERSION_1_2) |
-# define TEXTURE_OBJECT 1 |
-#elif defined(GL_EXT_texture_object) |
-# define TEXTURE_OBJECT 1 |
-# define glBindTexture(A,B) glBindTextureEXT(A,B) |
-# define glGenTextures(A,B) glGenTexturesEXT(A,B) |
-# define glDeleteTextures(A,B) glDeleteTexturesEXT(A,B) |
-#endif |
- |
-unsigned char *rgb_565_buf = NULL; //RGB 16 bpp Buffer |
-unsigned char *video_buf = NULL; //Video Buffer |
- |
-unsigned long int RGB565MEM = WIDTH * HEIGHT * BYTES_PP; // Total video mem |
- |
-unsigned long int PERIOD_REFRESH = 30000; |
-unsigned long int PERIOD_DISEGNA = 30000; |
- |
-unsigned long int WCET_REFRESH, WCET_DISEGNA; |
- |
-TASK refesh(void); |
-TASK disegna(void); |
- |
-PID refresh_PID, disegna_PID; |
- |
-static void draw( void ) |
-{ |
- glDepthFunc(GL_EQUAL); |
- /* glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );*/ |
- glClear( GL_COLOR_BUFFER_BIT ); |
- |
- glColor3f( 1.0, 1.0, 1.0 ); |
- |
- /* draw first polygon */ |
- glPushMatrix(); |
- glTranslatef( -1.0, 0.0, 0.0 ); |
- glRotatef( Angle, 0.0, 0.0, 1.0 ); |
- if (UseObj) { |
-#ifdef TEXTURE_OBJECT |
- glBindTexture( GL_TEXTURE_2D, TexObj[0] ); |
-#endif |
- } |
- else { |
- glCallList( TexObj[0] ); |
- } |
- glBegin( GL_POLYGON ); |
- glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 ); |
- glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 ); |
- glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 ); |
- glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 ); |
- glEnd(); |
- glPopMatrix(); |
- |
- /* draw second polygon */ |
- glPushMatrix(); |
- glTranslatef( 1.0, 0.0, 0.0 ); |
- glRotatef( Angle-90.0, 0.0, 1.0, 0.0 ); |
- if (UseObj) { |
-#ifdef TEXTURE_OBJECT |
- glBindTexture( GL_TEXTURE_2D, TexObj[1] ); |
-#endif |
- } |
- else { |
- glCallList( TexObj[1] ); |
- } |
- glBegin( GL_POLYGON ); |
- glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 ); |
- glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 ); |
- glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 ); |
- glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 ); |
- glEnd(); |
- glPopMatrix(); |
- |
-} |
- |
-static void gl_init() |
-{ |
- |
- static int twidth=8, theight=8; |
- static GLubyte tex1[] = { |
- 0, 0, 0, 1, 1, 1, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 1, 0, 0, 0, 0, 0, |
- 0, 0, 0, 1, 1, 1, 0, 0 }; |
- |
- static GLubyte tex2[] = { |
- 0, 0, 0, 2, 2, 2, 0, 0, |
- 0, 0, 2, 0, 0, 0, 0, 0, |
- 0, 0, 2, 0, 0, 0, 0, 0, |
- 0, 0, 0, 2, 0, 0, 0, 0, |
- 0, 0, 0, 0, 2, 0, 0, 0, |
- 0, 0, 0, 0, 0, 2, 0, 0, |
- 0, 0, 0, 0, 0, 2, 0, 0, |
- 0, 0, 2, 2, 2, 0, 0, 0 }; |
- |
- GLubyte tex[64][3]; |
- GLint i, j; |
- |
- //Create the OSMesa Context |
- ctx = OSMesaCreateContext(OSMESA_RGB_565, NULL); |
- |
- //Make Current Context |
- OSMesaMakeCurrent(ctx, rgb_565_buf, GL_UNSIGNED_SHORT_5_6_5, WIDTH, HEIGHT); |
- |
- UseObj = GL_TRUE; |
- |
- glDisable( GL_DITHER ); |
- |
- /* Setup texturing */ |
- glEnable( GL_TEXTURE_2D ); |
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); |
- glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); |
- |
- /* generate texture object IDs */ |
- if (UseObj) { |
-#ifdef TEXTURE_OBJECT |
- glGenTextures( 2, TexObj ); |
-#endif |
- } |
- else { |
- TexObj[0] = glGenLists(2); |
- TexObj[1] = TexObj[0]+1; |
- } |
- |
- /* setup first texture object */ |
- if (UseObj) { |
-#ifdef TEXTURE_OBJECT |
- glBindTexture( GL_TEXTURE_2D, TexObj[0] ); |
- assert(glIsTexture(TexObj[0])); |
-#endif |
- } |
- else { |
- glNewList( TexObj[0], GL_COMPILE ); |
- } |
- /* red on white */ |
- for (i=0;i<theight;i++) { |
- for (j=0;j<twidth;j++) { |
- int p = i*twidth+j; |
- if (tex1[(theight-i-1)*twidth+j]) { |
- tex[p][0] = 255; tex[p][1] = 0; tex[p][2] = 0; |
- } |
- else { |
- tex[p][0] = 255; tex[p][1] = 255; tex[p][2] = 255; |
- } |
- } |
- } |
- |
- glTexImage2D( GL_TEXTURE_2D, 0, 3, twidth, theight, 0, |
- GL_RGB, GL_UNSIGNED_BYTE, tex ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); |
- if (!UseObj) { |
- glEndList(); |
- } |
- /* end of texture object */ |
- |
- /* setup second texture object */ |
- if (UseObj) { |
-#ifdef TEXTURE_OBJECT |
- glBindTexture( GL_TEXTURE_2D, TexObj[1] ); |
- assert(glIsTexture(TexObj[1])); |
-#endif |
- assert(!glIsTexture(TexObj[1] + 999)); |
- } |
- else { |
- glNewList( TexObj[1], GL_COMPILE ); |
- } |
- /* green on blue */ |
- for (i=0;i<theight;i++) { |
- for (j=0;j<twidth;j++) { |
- int p = i*twidth+j; |
- if (tex2[(theight-i-1)*twidth+j]) { |
- tex[p][0] = 0; tex[p][1] = 255; tex[p][2] = 0; |
- } |
- else { |
- tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 255; |
- } |
- } |
- } |
- glTexImage2D( GL_TEXTURE_2D, 0, 3, twidth, theight, 0, |
- GL_RGB, GL_UNSIGNED_BYTE, tex ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); |
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); |
- if (!UseObj) { |
- glEndList(); |
- } |
- /* end texture object */ |
- |
- glViewport(0, 0, (GLint)WIDTH, (GLint)HEIGHT); |
- glMatrixMode(GL_PROJECTION); |
- glLoadIdentity(); |
- /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/ |
- glFrustum( -2.0, 2.0, 2.0, -2.0, 6.0, 20.0 ); |
- glMatrixMode(GL_MODELVIEW); |
- glLoadIdentity(); |
- glTranslatef( 0.0, 0.0, -8.0 ); |
- |
-} |
- |
-void program_end(void *arg) |
-{ |
- |
- OSMesaDestroyContext(ctx); |
- free(rgb_565_buf); |
- |
- exit(0); |
- |
-} |
- |
-void program_key_end(KEY_EVT *k) |
-{ |
- |
- exit(0); |
- |
-} |
- |
-TASK refresh(void) |
-{ |
- |
- while(1) { |
- |
- memcpy((video_buf+40*WIDTH*2), rgb_565_buf, RGB565MEM); |
- task_endcycle(); |
- |
- } |
- |
- exit(0); |
- |
-} |
- |
- |
-TASK disegna(void) |
-{ |
- |
- char text[100]; |
- TIME disegna_TIME, refresh_TIME; |
- |
- while(1) { |
- |
- jet_gettable(refresh_PID, &refresh_TIME, 1); |
- jet_gettable(disegna_PID, &disegna_TIME, 1); |
- |
- Angle += 2.0; |
- |
- draw(); |
- |
- sprintf(text,"Hard Task Refresh PER:%6d us EX:%6d us",(int)PERIOD_REFRESH,(int)refresh_TIME); |
- grx_text(text,10,5,rgb16(0,0,255),0); |
- sprintf(text,"Hard Task Draw PER:%6d us EX:%6d us",(int)PERIOD_DISEGNA,(int)disegna_TIME); |
- grx_text(text,10,15,rgb16(0,0,255),0); |
- |
- task_endcycle(); |
- |
- } |
- |
- exit(0); |
- |
-} |
- |
-int main (int argc, char *argv[]) |
-{ |
- |
- HARD_TASK_MODEL ht_refresh, ht_disegna; |
- |
- clear(); |
- |
- WCET_REFRESH =((long int) PERIOD_REFRESH * (0.45)); |
- WCET_DISEGNA =((long int) PERIOD_DISEGNA * (0.45)); |
- |
- hard_task_default_model(ht_refresh); |
- hard_task_def_wcet(ht_refresh,WCET_REFRESH); |
- hard_task_def_mit(ht_refresh,PERIOD_REFRESH); |
- hard_task_def_usemath(ht_refresh); |
- hard_task_def_group(ht_refresh,1); |
- hard_task_def_ctrl_jet(ht_refresh); |
- |
- refresh_PID = task_create("refresh", refresh, &ht_refresh, NULL); |
- if (refresh_PID == -1) { |
- exit(4); |
- } |
- |
- hard_task_default_model(ht_disegna); |
- hard_task_def_mit(ht_disegna,PERIOD_DISEGNA); |
- hard_task_def_wcet(ht_disegna,WCET_DISEGNA); |
- hard_task_def_group(ht_disegna,1); |
- hard_task_def_ctrl_jet(ht_disegna); |
- hard_task_def_usemath(ht_disegna); |
- hard_task_def_stack(ht_disegna,30000); |
- |
- disegna_PID = task_create("disegna", disegna, &ht_disegna, NULL); |
- if (disegna_PID == -1) { |
- exit(4); |
- } |
- |
- { |
- KEY_EVT k; |
- k.flag = CNTL_BIT; |
- k.scan = KEY_C; |
- k.ascii = 'c'; |
- k.status = KEY_PRESSED; |
- keyb_hook(k, program_key_end, FALSE); |
- |
- k.flag = CNTR_BIT; |
- k.status = KEY_PRESSED; |
- keyb_hook(k, program_key_end, FALSE); |
- } |
- |
- rgb_565_buf = malloc(RGB565MEM); |
- |
- gl_init(); |
- |
- video_buf = (unsigned char *)video_memory; |
- //video_buf = (unsigned char *)malloc(640*480*2); |
- |
- memset(rgb_565_buf, 0, RGB565MEM); |
- |
- group_activate(1); |
- |
- return 0; |
- |
-} |
Index: rel_1_5_3/mesatex/readme.txt |
=================================================================== |
--- rel_1_5_3/mesatex/readme.txt (revision 1614) |
+++ rel_1_5_3/mesatex/readme.txt (nonexistent) |
@@ -1,44 +0,0 @@ |
--------------------------------------- |
-MESA Demo (tex) |
- |
-by |
- |
-Giacomo Guidi <giacomo@gandalf.sssup.it> |
- |
-Last update 17/03/2003 |
--------------------------------------- |
- |
-This is a simple test demo for the MESA (5.0) |
-libraries, the low level graphic drivers is |
-the SVGA (from the SVGAlib) |
- |
-See drivers/svga/readme for supported cards |
- |
--------------------------------------- |
- |
-The demo is composed by: |
- |
-MAKEFILE The makefile used to compile the application |
-README.TXT This file |
-INITFILE.C The init file |
-MESATEX.C The MESA Demo |
- |
--------------------------------------- |
- |
-- To specify your card change the line |
- |
-#define CARD <driver name> |
- |
-- The demo calls the grx and off-screen Mesa functions. |
-The resolution must be 16 bitsperpixel (64K colors) and |
-the graphic access mode must be linear. |
- |
-- There are two buffers |
- |
- The video buffer (video_buf) |
- The virtual buffer (rgb_565_buf) |
- |
- copy_videomem_16to16 links these buffers |
- |
- |
- |
Index: rel_1_5_3/mesatex/makefile |
=================================================================== |
--- rel_1_5_3/mesatex/makefile (revision 1614) |
+++ rel_1_5_3/mesatex/makefile (nonexistent) |
@@ -1,16 +0,0 @@ |
-# |
-# |
-# |
- |
-ifndef BASE |
-BASE=../.. |
-endif |
-include $(BASE)/config/config.mk |
- |
-PROGS = mesatex |
- |
-include $(BASE)/config/example.mk |
- |
-mesatex: |
- make -f $(SUBMAKE) APP=mesatex INIT= OTHEROBJS="initfile.o" SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __FB__ __OSMESA__" |
- |
Index: rel_1_5_3/jumpball/demo.h |
=================================================================== |
--- rel_1_5_3/jumpball/demo.h (revision 1614) |
+++ rel_1_5_3/jumpball/demo.h (nonexistent) |
@@ -1,190 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: demo.h,v 1.8 2006-06-27 09:27:15 tullio Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.8 $ |
- Last update: $Date: 2006-06-27 09:27:15 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2000 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
- |
-#include <ll/ll.h> |
-#include <kernel/types.h> |
-#include <kernel/descr.h> |
-#include <math.h> |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/* Subparts */ |
-#define JET_ON |
-#define BALL_ON |
- |
- |
-/* CPU Speed Selection |
- -------------------------------------------------------------------- |
- 1700 - Pentium 4 1.7 GHz |
- 1300 - Centrino 1.3 GHz |
- 400 - Pentium 2 400 MHz |
- 133 - Pentium 1 133 MHz |
-*/ |
-#define CPU 400 |
- |
-/* |
- * |
- * WCET, Periods and Models |
- * |
- */ |
- |
-#if CPU==133 |
-#define WCET_JETCTRL 10000 |
-#define WCET_JETDUMMY 300 |
-#define WCET_JETSLIDE 2000 |
-#define WCET_BALL 250 |
-#define WCET_HARD_BALL 1000 |
-#define BALL_DELAY 10000 |
-#endif |
- |
-#if CPU==400 |
-#define WCET_JETCTRL 7500 |
-#define WCET_JETDUMMY 400 |
-#define WCET_JETSLIDE 2100 |
-#define WCET_BALL 250 |
-#define WCET_HARD_BALL 480 |
-#define BALL_DELAY 10000 |
-#endif |
- |
-#if CPU==1300 |
-#define WCET_JETCTRL 4500 |
-#define WCET_JETDUMMY 200 |
-#define WCET_JETSLIDE 1300 |
-#define WCET_BALL 250 |
-#define WCET_HARD_BALL 650 |
-#define BALL_DELAY 100000 |
-#endif |
- |
-#if CPU==1700 |
-#define WCET_JETCTRL 4500 |
-#define WCET_JETDUMMY 100 |
-#define WCET_JETSLIDE 1300 |
-#define WCET_BALL 250 |
-#define WCET_HARD_BALL 410 |
-#define BALL_DELAY 100000 |
-#endif |
- |
-#define PERIOD_JETCTRL 100000 |
-#define PERIOD_JETDUMMY 100000 |
-#define PERIOD_JETSLIDE 100000 |
-#define PERIOD_BALL 10000 |
- |
-/* |
- * |
- * Global Stuffs |
- * |
- */ |
- |
-extern PID shutdown_task_PID; |
- |
-/* graphic mutex... */ |
-extern mutex_t mutex; |
- |
-/* useful colors... */ |
-extern int white; |
-extern int black; |
-extern int red; |
-extern int gray; |
- |
-void init_jetcontrol(); |
-void init_ball(void); |
-void scenario_jetcontrol(); |
-void scenario_ball(); |
-char *itoa(int n, char *s); |
-int myrand(int x); |
- |
-/* |
- * |
- * JETCONTROL stuffs |
- * |
- */ |
- |
-#define JET_NTASK 35 |
-#define JET_Y_NAME 170 |
- |
-/* |
- * |
- * ATTENTION: the following PID MUST match |
- * with the one assigned by Shark to the |
- * Dummy task during dummy module creation. |
- * |
- */ |
-#define DUMMY_PID 2 |
- |
-#define JET_DUMMY_WIDTH 210 |
-#define JET_DUMMY_HEIGHT 80 |
- |
-/* the point (x, y) is the top left corner */ |
-#define JET_DUMMY_X 428 |
-#define JET_DUMMY_Y 65 |
- |
-#define JET_SLIDE_WIDTH 50 |
-#define JET_SLIDE_X 576 |
- |
-/* |
- * |
- * BALL stuffs |
- * |
- */ |
- |
-// x and y corners are specified whithout consider a border of 3 pixels |
-#define BALL_Y 450 /* position of the floor */ |
-#define BALL_HEIGHT 385 /* initial height of the ball */ |
-#define BALL_XMIN 10 /* min position X of the ball */ |
-#define BALL_XMAX 370 /* max position X of the ball */ |
-#define BALL_VELX 5. /* horizontal ball velocity */ |
-#define BALL_VYMIN 11. /* min ground speed */ |
-#define BALL_MAX_P 60 /* max number of balls */ |
- |
-#define BALL_GROUP 2 /* task group of the balls */ |
Index: rel_1_5_3/jumpball/readme.txt |
=================================================================== |
--- rel_1_5_3/jumpball/readme.txt (revision 1614) |
+++ rel_1_5_3/jumpball/readme.txt (nonexistent) |
@@ -1,94 +0,0 @@ |
----------------------------------- |
-Jumping Balls demo |
- |
-by |
- |
-Paolo Gai 1999-2001 - pj@sssup.it |
- |
----------------------------------- |
- |
-This demo was created to show some S.Ha.R.K. functionalities in the course |
-of Informatica Industriale , University of Pavia, Italy. |
- |
-The demo is composed by an application (derived by the template application |
-distributed on the web site) and two init files. |
- |
-The demo is composed by: |
- |
-MAKEFILE The makefile used to compile the application; |
- demo is the rule to compile the application with a CBS scheduler |
- demo2 is the rule to compile the application with a RR scheduler |
-README.TXT This file |
-DEMO.H Some constants used into the demo |
-ECP.C, ERN.C, RRP.C, RRN.C Various initfiles |
-INITFIL2.C The EDF initfile |
-INITFILE.C A makefile that cover either EDF+CBS and RR |
-BALL.C The Jumping balls part of the demo |
-DEMO.C The main() function and some other utility function |
-JETCTRL.C The JET part of the demo |
- |
-The demo works as follows: |
-- It works at 640x480 16 bit colors |
-- on the left, there is the jumping ball arena, on the rigth there is the |
- statistics about the tasks into the system. |
- |
-- the tasks are guaranteed using CBS and EDF. The wcet and mean execution |
- time on my portable after a few minutes are (us): |
- |
- JetCtrl 7400 max 7500 CBS met |
- JetDummy 135 max 200 CBS met |
- JetSlide 2100 max 2100 CBS met |
- Balls 276 max 380 EDF wcet for hard ball,100 CBS met for soft ones |
- |
- The system should go overloaded with 40 soft balls. |
- |
-- The idea is the following: |
- - first, an edf guaranteed ball is created. |
- - then, create a set of soft ball using space. since their met is < than the |
- real met, they posticipate the deadlines. |
- - if they are killed, they remain for some seconds in the zombie state |
- - if a set of soft ball arde created (i.e., 10), and after a while all the |
- others are created, the bandwidth is fully used, and the task posticipate |
- their deadlines. the first set of tasks stops jumping when the bandwidth |
- is full utilized by the newest balls until all the tasks have similar |
- deadlines. |
- - Note on the left the slides that represents the relative ratio |
- between the tasks. |
- - Note that in overload conditions the EDF task is still guaranteed |
- - Note that PI is used with EDF, also if no theory says that it is good: |
- - S.Ha.R.K. allows that, it is the user that have to choose if that is |
- a non-sense |
- - PI is independent from the implemnentation of the scheduling modules |
- - if the second init file is used, RR is used instead of EDF+CBS. |
- - In overload condition RR perform differently from EDF+CBS, giving to |
- each task an equal fraction of bandwidth |
- |
- - note also: |
- - the redefinition of the standard exception handler |
- - the redefinition of the keys and the initialization of the keyboard |
- - the myend exit function |
- - the main() that terminates |
- - the two parts (ball and jet) can be excluded using a #define |
- |
-If You have any question, please contact the author... |
- |
-Update (2003/12/19): |
-Just some more notes... |
-I usually show the four demos in the following order: |
- |
-(first of all, tune the demo depending on how fast your notebook is; see demo.h) |
- |
-ECP - EDF with CBS and PI... the white EDF ball still work also in overload; CBS balls just slow down but they still get their guaranteed bandwidth |
- |
-RRP - Round Robin with Priority inheritance ... the EDF ball is at the same level of the others, all slow down... |
- |
-RRN - 2 levels of Round Robin, without Priority inheritance ... when |
-there is overload, the white ball works ok, but the other have an impredicible |
-behavior (they execute many instances in one RR period) |
- |
-ERN - EDF, RR, no priority inheritance - the white ball misses his deadline |
-just when there is an overload (all the other balls are queued on the same |
-semaphore, so the blocking time increase, and when there is overload the EDF |
-task misses also if it has not consumed his bandwidth). Note that it happens |
-also if the EDF task consume just a few microseconds... Real time does not |
-means "fast" :-) |
Index: rel_1_5_3/jumpball/ball.c |
=================================================================== |
--- rel_1_5_3/jumpball/ball.c (revision 1614) |
+++ rel_1_5_3/jumpball/ball.c (nonexistent) |
@@ -1,246 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: ball.c,v 1.8 2005-05-10 17:21:17 mauro Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.8 $ |
- Last update: $Date: 2005-05-10 17:21:17 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2000 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-/*--------------------------------------------------------------*/ |
-/* SIMULATION OF JUMPING BALLS */ |
-/*--------------------------------------------------------------*/ |
- |
-#include "demo.h" |
-#include <kernel/func.h> |
-#include <stdlib.h> |
- |
-#define R 8 /* dimension of a ball */ |
-#define G 9.8 /* acceleration of gravity */ |
- |
-static int ballexit = 0; |
-static int npc = 0; /* number of tasks created */ |
- |
-/*--------------------------------------------------------------*/ |
-/* Delay function for jumping balls */ |
-/*--------------------------------------------------------------*/ |
- |
-void my_delay(void) |
-{ |
- int xxx; |
- for (xxx=0; xxx<BALL_DELAY; xxx++); |
-} |
- |
-/*--------------------------------------------------------------*/ |
-/* Periodic task for ball simulation */ |
-/*--------------------------------------------------------------*/ |
- |
-TASK palla(int i) |
-{ |
-int x, y; /* coordinate grafiche pallina */ |
-int ox, oy; /* vecchia posizione pallina */ |
-int x0, y0; /* posizione iniziale X pallina */ |
-float vx, vy; /* velocit
della pallina */ |
-float vy0; /* velocita' pallina al primo rimbalzo */ |
-float ty, tx; /* variabile temporale */ |
-float dt; /* incremento temporale */ |
- |
- y = oy = y0 = BALL_HEIGHT; |
- x = ox = x0 = BALL_XMIN; |
- |
- vy0= sqrt(2. * G * (float)BALL_HEIGHT); |
- vy = 0; |
- vx = BALL_VELX + myrand(9); |
- tx = 0; |
- ty = 0; |
- dt = ((float)PERIOD_BALL)/100000; |
- |
- while (1) { |
- y = y0 + vy*ty - .5*G*ty*ty; |
- x = x0 + vx * tx; |
- |
- if (y < 0) { |
- y = 0; |
- |
- if (vy == 0.0) |
- vy = vy0; |
- else if (vy < BALL_VYMIN) |
- vy = vy0 * (1.0 - myrand(50)/100.0); |
- else |
- vy = 0.9 * vy; |
- |
- ty = 0.0; |
- y0 = 0; |
- } |
- |
- if (x > BALL_XMAX) { |
- tx = 0.0; |
- x0 = BALL_XMAX; |
- vx = -vx; |
- x = x0 + vx * tx; |
- } |
- |
- if (x < BALL_XMIN) { |
- tx = 0.0; |
- x0 = BALL_XMIN; |
- vx = -vx; |
- x = x0 + vx * tx; |
- } |
- |
- mutex_lock(&mutex); |
- grx_disc(ox, oy, R, 0); |
- ox = x; |
- oy = BALL_Y - y; |
- mutex_unlock(&mutex); |
- |
- if (ballexit && i!=0xFFFF) { |
- npc--; |
- return 0; |
- } |
- |
- mutex_lock(&mutex); |
- grx_disc(ox, oy, R, i); |
- mutex_unlock(&mutex); |
- |
- my_delay(); |
- |
- ty += dt; |
- tx += dt; |
- task_endcycle(); |
- } |
-} |
- |
-void killball(KEY_EVT *k) |
-{ |
- ballexit = 1; |
-} |
- |
-void ballfun(KEY_EVT *k) |
-{ |
- SOFT_TASK_MODEL mp; |
- int r,g,b; |
- PID pid; |
- char palla_str[]="palla "; |
- |
- if (npc == BALL_MAX_P) return; |
- |
- ballexit = 0; |
- |
- r = 64 + myrand(190); |
- g = 64 + myrand(190); |
- b = 64 + myrand(190); |
- |
- itoa(npc,palla_str+5); |
- |
- soft_task_default_model(mp); |
- soft_task_def_level(mp,2); |
- soft_task_def_ctrl_jet(mp); |
- soft_task_def_arg(mp, (void *)rgb16(r,g,b)); |
- soft_task_def_group(mp, BALL_GROUP); |
- soft_task_def_met(mp, WCET_BALL); |
- soft_task_def_period(mp,PERIOD_BALL); |
- soft_task_def_usemath(mp); |
- pid = task_create(palla_str, palla, &mp, NULL); |
- |
- if (pid != NIL) { |
- task_activate(pid); |
- npc++; |
- } |
-} |
- |
-void hardball() |
-{ |
- HARD_TASK_MODEL mp; |
- int r,g,b; |
- PID pid; |
- |
- r = 255; |
- g = 255; |
- b = 255; |
- |
- hard_task_default_model(mp); |
- hard_task_def_ctrl_jet(mp); |
- hard_task_def_arg(mp, (void *)rgb16(r,g,b)); |
- hard_task_def_wcet(mp, WCET_HARD_BALL); |
- hard_task_def_mit(mp,PERIOD_BALL); |
- hard_task_def_usemath(mp); |
- pid = task_create("pallaEDF", palla, &mp, NULL); |
- if (pid == NIL) { |
- sys_shutdown_message("Could not create task <pallaEDF>"); |
- exit(1); |
- } |
- else |
- task_activate(pid); |
-} |
- |
- |
-/*--------------------------------------------------------------*/ |
-/* MAIN process */ |
-/*--------------------------------------------------------------*/ |
- |
-void scenario_ball() |
-{ |
- grx_text("Noise", 0, 45 /*BALL_Y-BALL_HEIGHT-15*/, rgb16(0,0,255), black); |
- grx_line(0,55,383,55,red); |
- grx_rect(BALL_XMIN-R-1, BALL_Y-BALL_HEIGHT-R-1, |
- BALL_XMAX+R+1, BALL_Y+R+1, rgb16(0,200,0)); |
-} |
- |
-void init_ball(void) |
-{ |
- KEY_EVT k; |
- |
- hardball(); |
- |
- k.flag = 0; |
- k.scan = KEY_SPC; |
- k.ascii = ' '; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,ballfun,FALSE); |
- |
- k.flag = 0; |
- k.scan = KEY_BKS; |
- k.ascii = 0; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,killball,FALSE); |
-} |
- |
-/*--------------------------------------------------------------*/ |
Index: rel_1_5_3/jumpball/makefile |
=================================================================== |
--- rel_1_5_3/jumpball/makefile (revision 1614) |
+++ rel_1_5_3/jumpball/makefile (nonexistent) |
@@ -1,24 +0,0 @@ |
-# |
-# |
-# |
- |
-ifndef BASE |
-BASE=../.. |
-endif |
-include $(BASE)/config/config.mk |
- |
-PROGS= ecp ern rrp rrn |
- |
-include $(BASE)/config/example.mk |
- |
-ecp: |
- make -f $(SUBMAKE) APP=ecp INIT= OTHEROBJS="demo.o ball.o jetctrl.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __FB__" |
- |
-ern: |
- make -f $(SUBMAKE) APP=ern INIT= OTHEROBJS="demo.o ball.o jetctrl.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __FB__" |
- |
-rrp: |
- make -f $(SUBMAKE) APP=rrp INIT= OTHEROBJS="demo.o ball.o jetctrl.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __FB__" |
- |
-rrn: |
- make -f $(SUBMAKE) APP=rrn INIT= OTHEROBJS="demo.o ball.o jetctrl.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __FB__" |
Index: rel_1_5_3/jumpball/rrn.c |
=================================================================== |
--- rel_1_5_3/jumpball/rrn.c (revision 1614) |
+++ rel_1_5_3/jumpball/rrn.c (nonexistent) |
@@ -1,218 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: rrn.c,v 1.9 2006-03-09 14:17:03 tullio Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.9 $ |
- Last update: $Date: 2006-03-09 14:17:03 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2003 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "rr/rr/rr.h" |
-#include "rrsoft/rrsoft/rrsoft.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include "nop/nop/nop.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 2000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- RR_register_level(RRTICK, RR_MAIN_NO, mb); // this module remains empty!!! |
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- CABS_register_module(); |
- |
- NOP_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- FB26_init(); |
- |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
-void app_mutex_init(mutex_t *m) |
-{ |
- NOP_mutexattr_t attr; |
- |
- NOP_mutexattr_default(attr); |
- |
- mutex_init(m, &attr); |
-} |
- |
Index: rel_1_5_3/jumpball/rrp.c |
=================================================================== |
--- rel_1_5_3/jumpball/rrp.c (revision 1614) |
+++ rel_1_5_3/jumpball/rrp.c (nonexistent) |
@@ -1,218 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: rrp.c,v 1.9 2006-03-09 14:17:03 tullio Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.9 $ |
- Last update: $Date: 2006-03-09 14:17:03 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2003 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "rr/rr/rr.h" |
-#include "rrsoft/rrsoft/rrsoft.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include "pi/pi/pi.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 2000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD); |
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- CABS_register_module(); |
- |
- PI_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- FB26_init(); |
- |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
-void app_mutex_init(mutex_t *m) |
-{ |
- PI_mutexattr_t attr; |
- |
- PI_mutexattr_default(attr); |
- |
- mutex_init(m, &attr); |
-} |
- |
Index: rel_1_5_3/jumpball/demo.c |
=================================================================== |
--- rel_1_5_3/jumpball/demo.c (revision 1614) |
+++ rel_1_5_3/jumpball/demo.c (nonexistent) |
@@ -1,198 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: demo.c,v 1.8 2005-01-08 14:35:17 pj Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.8 $ |
- Last update: $Date: 2005-01-08 14:35:17 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2000-2003 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "demo.h" |
-#include <kernel/func.h> |
-#include <string.h> |
-#include <stdlib.h> |
- |
-/* useful colors... */ |
-int white; |
-int black; |
-int red; |
-int gray; |
- |
-void app_mutex_init(mutex_t *m); |
- |
-static void version( void ) |
-{ |
- cprintf( "S.Ha.R.K. Jumpball Demo 1.0\n" ); |
- cprintf( "---------------------------\n" ); |
- cprintf( "by Paolo Gai 1999-2001\n" ); |
- cprintf( " <pj@sssup.it>\n" ); |
- cprintf( "---------------------------\n" ); |
-} |
- |
-int myrand(int x) |
-{ |
- return rand()%x; |
-} |
- |
-void reverse(char s[]) |
-{ |
- int c, i, j; |
- |
- for (i = 0, j = strlen(s)-1; i<j; i++, j--) |
- { |
- c = s[i]; |
- s[i] = s[j]; |
- s[j] = c; |
- } |
-} |
- |
-char * itoa(int n, char *s) |
-{ |
- int i, sign; |
- |
- if ((sign = n) < 0) |
- n = -n; |
- |
- i = 0; |
- |
- do |
- { |
- s[i++] = n % 10 + '0'; |
- } while ((n /= 10) > 0); |
- |
- if (sign < 0) |
- s[i++] = '-'; |
- |
- s[i] = 0; |
- |
- reverse(s); |
- |
- return s; |
-} |
- |
- |
-void scenario() |
-{ |
- grx_text("S.Ha.R.K. Jumpball Demo 1.0", 0, 0, rgb16(0,255,0), black ); |
- grx_text(" by Paolo Gai 1999-2001" , 0, 8, rgb16(0,255,0), black ); |
- grx_text(" pj@sssup.it" , 0,16, rgb16(0,255,0), black ); |
- |
- grx_text("Ctrl-C, Ctrr-C, Enter: exit" ,320, 0, gray, black ); |
- grx_text("Alt-C : void statistics" ,320, 8, gray, black ); |
- grx_text("Space : create noise ball",320,16, gray, black ); |
- grx_text("Backspace : kill noise balls" ,320,24, gray, black ); |
- |
- |
- #ifdef JET_ON |
- scenario_jetcontrol(); |
- #endif |
- |
- #ifdef BALL_ON |
- scenario_ball(); |
- #endif |
-} |
- |
-void endfun(KEY_EVT *k) |
-{ |
- exit(0); |
-} |
- |
-void zerofun(KEY_EVT *k) |
-{ |
- int i; |
- for (i=0; i<MAX_PROC; i++) jet_delstat(i); |
-} |
- |
-int main(int argc, char **argv) |
-{ |
- |
- KEY_EVT k; |
- |
- version(); |
- |
- srand(4); |
- |
- k.flag = CNTR_BIT; |
- k.scan = KEY_C; |
- k.ascii = 'c'; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,endfun,FALSE); |
- k.flag = CNTL_BIT; |
- k.scan = KEY_C; |
- k.ascii = 'c'; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,endfun,FALSE); |
- k.flag = ALTL_BIT; |
- k.scan = KEY_C; |
- k.ascii = 'c'; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,zerofun,FALSE); |
- k.flag = 0; |
- k.scan = KEY_ENT; |
- k.ascii = 13; |
- k.status = KEY_PRESSED; |
- keyb_hook(k,endfun,FALSE); |
- |
- /* init the graphic mutex */ |
- app_mutex_init(&mutex); |
- |
- /* useful colors ... */ |
- white = rgb16(255,255,255); |
- black = rgb16(0,0,0); |
- red = rgb16(255,0,0); |
- gray = rgb16(128,128,128); |
- |
- scenario(); |
- |
- #ifdef JET_ON |
- init_jetcontrol(); |
- #endif |
- |
- #ifdef BALL_ON |
- init_ball(); |
- #endif |
- |
- group_activate(1); |
- |
- return 0; |
-} |
- |
- |
Index: rel_1_5_3/jumpball/ern.c |
=================================================================== |
--- rel_1_5_3/jumpball/ern.c (revision 1614) |
+++ rel_1_5_3/jumpball/ern.c (nonexistent) |
@@ -1,220 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: ern.c,v 1.10 2006-07-05 08:27:27 tullio Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.10 $ |
- Last update: $Date: 2006-07-05 08:27:27 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2003 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "rr/rr/rr.h" |
-#include "rrsoft/rrsoft/rrsoft.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include "nop/nop/nop.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 2000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- CABS_register_module(); |
- |
- NOP_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- FB26_init(); |
- |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
-void app_mutex_init(mutex_t *m) |
-{ |
- NOP_mutexattr_t attr; |
- |
- NOP_mutexattr_default(attr); |
- |
- mutex_init(m, &attr); |
-} |
- |
Index: rel_1_5_3/jumpball/ecp.c |
=================================================================== |
--- rel_1_5_3/jumpball/ecp.c (revision 1614) |
+++ rel_1_5_3/jumpball/ecp.c (nonexistent) |
@@ -1,216 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: ecp.c,v 1.9 2006-03-09 14:17:03 tullio Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.9 $ |
- Last update: $Date: 2006-03-09 14:17:03 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2003 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include "kernel/kern.h" |
-#include "intdrive/intdrive/intdrive.h" |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
-#include "cabs/cabs/cabs.h" |
- |
-#include "pi/pi/pi.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
-#include <drivers/shark_fb26.h> |
- |
-#define FRAME_BUFFER_DEVICE 0 |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 2000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = -1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- CABS_register_module(); |
- PI_register_module(); |
- |
- return TICK; |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-int device_drivers_init() { |
- |
- int res; |
- KEYB_PARMS kparms = BASE_KEYB; |
- |
- LINUXC26_register_module(TRUE); |
- |
- PCI26_init(); |
- |
- INPUT26_init(); |
- |
- keyb_def_ctrlC(kparms, NULL); |
- |
- KEYB26_init(&kparms); |
- |
- FB26_init(); |
- |
- res = FB26_open(FRAME_BUFFER_DEVICE); |
- if (res) { |
- cprintf("Error: Cannot open graphical mode\n"); |
- KEYB26_close(); |
- INPUT26_close(); |
- exit(1); |
- } |
- |
- FB26_use_grx(FRAME_BUFFER_DEVICE); |
- |
- FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16"); |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_close() { |
- |
- FB26_close(FRAME_BUFFER_DEVICE); |
- |
- KEYB26_close(); |
- |
- INPUT26_close(); |
- |
- return 0; |
- |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void call_shutdown_task(void *arg) |
-{ |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
- |
-} |
- |
-void app_mutex_init(mutex_t *m) |
-{ |
- PI_mutexattr_t attr; |
- |
- PI_mutexattr_default(attr); |
- |
- mutex_init(m, &attr); |
-} |
Index: rel_1_5_3/jumpball/jetctrl.c |
=================================================================== |
--- rel_1_5_3/jumpball/jetctrl.c (revision 1614) |
+++ rel_1_5_3/jumpball/jetctrl.c (nonexistent) |
@@ -1,236 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * (see the web pages for full authors list) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/** |
- ------------ |
- CVS : $Id: jetctrl.c,v 1.5 2005-01-08 14:35:17 pj Exp $ |
- |
- File: $File$ |
- Revision: $Revision: 1.5 $ |
- Last update: $Date: 2005-01-08 14:35:17 $ |
- ------------ |
-**/ |
- |
-/* |
- * Copyright (C) 2000 Paolo Gai |
- * |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
- |
-// JetControl |
- |
-#include "demo.h" |
-#include "kernel/func.h" |
- |
-TASK jetdummy_task(void *arg) |
-{ |
- TIME now_dummy, last_dummy, diff_dummy, slice; |
- struct timespec now, last, diff; |
- int x = 0; |
- int height; |
- |
- NULL_TIMESPEC(&last); |
- last_dummy = 0; |
- for (;;) { |
- task_nopreempt(); |
- jet_getstat(DUMMY_PID, NULL, NULL, NULL, &now_dummy); |
- sys_gettime(&now); |
- task_preempt(); |
- |
- SUBTIMESPEC(&now, &last, &diff); |
- slice = diff.tv_sec * 1000000 + diff.tv_nsec/1000; |
- diff_dummy = now_dummy - last_dummy; |
- |
- height = (int)(JET_DUMMY_HEIGHT*((float)diff_dummy)/((float)slice)); |
- |
- TIMESPEC_ASSIGN(&last, &now); |
- last_dummy = now_dummy; |
- |
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y, |
- JET_DUMMY_X+x,JET_DUMMY_Y+height ,black); |
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y+height, |
- JET_DUMMY_X+x,JET_DUMMY_Y+JET_DUMMY_HEIGHT,white); |
- grx_line(JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y, |
- JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y+JET_DUMMY_HEIGHT,255); |
- |
- x = (x+1)%JET_DUMMY_WIDTH; |
- |
- task_endcycle(); |
- } |
-} |
- |
- |
-TASK jetctrl_task(void *arg) |
-{ |
- char st[50]; |
- TIME sum, max; |
- int n; |
- |
- PID i; |
- int printed = 0; |
- |
- for (;;) { |
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) { |
- if (jet_getstat(i, &sum, &max, &n, NULL) != -1) { |
- if (!n) n=1; |
- sprintf(st, "%6d %6d %10s", (int)sum/n, (int)max, proc_table[i].name); |
- grx_text(st, 384, JET_Y_NAME+16+printed*8, gray, black); |
- printed++; |
- } |
- } |
- while (printed<JET_NTASK) { |
- grx_text(" ", |
- 384, JET_Y_NAME+16+printed*8, gray, black); |
- printed++; |
- } |
- task_endcycle(); |
- } |
-} |
- |
-TASK jetslide_task(void *arg) |
-{ |
- TIME sum, curr, max; |
- |
- TIME total[JET_NTASK]; |
- int slides[JET_NTASK]; |
- |
- PID i; |
- int printed = 0; |
- |
- for (;;) { |
- // Fill the total array in a nonpreemptive section |
- task_nopreempt(); |
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) { |
- if (jet_getstat(i, &sum, NULL, NULL, &curr) != -1) { |
- total[printed] = sum+curr; |
- printed++; |
- } |
- } |
- task_preempt(); |
- |
- while (printed < JET_NTASK) |
- total[printed++] = 0; |
- |
- // Compute the Max elapsed time |
- max = 0; |
- for (i=0; i<JET_NTASK; i++) |
- if (total[i] > max) max = total[i]; |
- if (!max) max = 1; |
- |
- // Compute the slides width |
- for (i=0; i<JET_NTASK; i++) |
- slides[i] = (int)( (((float)total[i])/max) * JET_SLIDE_WIDTH); |
- |
- // print the data |
- for (i=0; i<JET_NTASK; i++) { |
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8, |
- JET_SLIDE_X+slides[i], JET_Y_NAME+23+i*8, gray); |
- grx_box(JET_SLIDE_X+slides[i], JET_Y_NAME+16+i*8, |
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+23+i*8, black); |
- } |
- |
- while (i<JET_NTASK) { |
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8, |
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+20+i*8, black); |
- i++; |
- } |
- task_endcycle(); |
- } |
-} |
- |
- |
-void scenario_jetcontrol(void) |
-{ |
- grx_text("System load" , 384, 45, rgb16(0,0,255), black); |
- grx_line(384,55,639,55,red); |
- |
- grx_text(" Mean Max Name Slide", 384, JET_Y_NAME, gray, black); |
- grx_line(384,JET_Y_NAME+10,639,JET_Y_NAME+10,gray); |
- |
- grx_rect(JET_DUMMY_X-1, JET_DUMMY_Y-1, |
- JET_DUMMY_X+JET_DUMMY_WIDTH, JET_DUMMY_Y+JET_DUMMY_HEIGHT+1, gray); |
- |
- grx_text("100%", JET_DUMMY_X-40, JET_DUMMY_Y, gray, black); |
- grx_text(" 0%", JET_DUMMY_X-40, JET_DUMMY_Y+JET_DUMMY_HEIGHT-8, gray, black); |
- |
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y, JET_DUMMY_X-5, JET_DUMMY_Y, gray); |
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y+JET_DUMMY_HEIGHT, JET_DUMMY_X-5, JET_DUMMY_Y+JET_DUMMY_HEIGHT, gray); |
-} |
- |
-void init_jetcontrol(void) |
-{ |
- SOFT_TASK_MODEL m3, m4, m5; |
- |
- PID p3, p4, p5; |
- |
- soft_task_default_model(m3); |
- soft_task_def_level(m3,2); |
- soft_task_def_period(m3, PERIOD_JETCTRL); |
- soft_task_def_met(m3, WCET_JETCTRL); |
- soft_task_def_ctrl_jet(m3); |
- soft_task_def_group(m3, 1); |
- p3 = task_create("jctrl", jetctrl_task, &m3, NULL); |
- if (p3 == -1) { |
- sys_shutdown_message("Could not create task <jetctrl> errno=%d", |
- errno); |
- exit(1); |
- } |
- |
- soft_task_default_model(m4); |
- soft_task_def_level(m4,2); |
- soft_task_def_period(m4, PERIOD_JETDUMMY); |
- soft_task_def_met(m4, WCET_JETDUMMY); |
- soft_task_def_group(m4, 1); |
- soft_task_def_usemath(m4); |
- soft_task_def_ctrl_jet(m4); |
- p4 = task_create("jdmy", jetdummy_task, &m4, NULL); |
- if (p4 == -1) { |
- sys_shutdown_message("Could not create task <jetdummy> errno=%d", |
- errno); |
- exit(1); |
- } |
- |
- soft_task_default_model(m5); |
- soft_task_def_level(m5,2); |
- soft_task_def_period(m5, PERIOD_JETSLIDE); |
- soft_task_def_met(m5, WCET_JETSLIDE); |
- soft_task_def_group(m5, 1); |
- soft_task_def_usemath(m5); |
- soft_task_def_ctrl_jet(m5); |
- p5 = task_create("jsli", jetslide_task, &m5, NULL); |
- if (p5 == -1) { |
- sys_shutdown_message("Could not create task <jetslide> errno=%d", |
- errno); |
- exit(1); |
- } |
-} |
- |
Index: rel_1_5_3/newtrace/readme |
=================================================================== |
--- rel_1_5_3/newtrace/readme (revision 1614) |
+++ rel_1_5_3/newtrace/readme (nonexistent) |
@@ -1,14 +0,0 @@ |
-This directory contains a set of sub directories containing all the tracer |
-examples and utilities. |
- |
-Here a short description of the contents |
- |
-utils - some small utilities: |
- |
- udpdump - save on a file the logged events sent through network |
- |
-udp - a small application that sends its trace data through the network |
- the new version also contains the code to configure the output to disk |
- |
-nosave - a simple tracer implementation without saving logged events |
- |
Index: rel_1_5_3/newtrace/makefile |
=================================================================== |
--- rel_1_5_3/newtrace/makefile (revision 1614) |
+++ rel_1_5_3/newtrace/makefile (nonexistent) |
@@ -1,15 +0,0 @@ |
-.PHONY: all clean |
- |
-all: |
- make -C udp |
- make -C nosave |
- make -C instr |
- make -C utils util_linux |
- |
-clean: |
- make -C udp clean |
- make -C nosave clean |
- make -C instr clean |
- make -C utils clean |
- |
- |
Index: rel_1_5_3/newtrace/instr/bezier_i.c |
=================================================================== |
--- rel_1_5_3/newtrace/instr/bezier_i.c (revision 1614) |
+++ rel_1_5_3/newtrace/instr/bezier_i.c (nonexistent) |
@@ -1,137 +0,0 @@ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <kernel/kern.h> |
-#include <tracer.h> |
- |
-#define PWCET_Automatic_Ipoint(a) TRACER_LOGEVENT(FTrace_EVT_ipoint,(a),0); |
- |
-/* here are the bezier curves defined |
-format: |
-{startpoint, endpoint, controlpoint1, controlpoint} |
-. |
-. |
-. */ |
-int curveno = 20; |
-int data[20][4][2] = { |
- {{123,321},{ 23,432},{345,120},{123, 98}}, |
- {{567, 31},{ 23, 24},{ 35,421},{123,398}}, |
- {{ 0, 21},{623,532},{145,323},{153, 68}}, |
- {{253,321},{ 23,432},{745,525},{423,198}}, |
- {{123,456},{ 23,482},{ 0,123},{123,128}}, |
- {{322, 21},{223,232},{ 45,224},{123,98}}, |
- {{423, 32},{123,332},{144,329},{123,98}}, |
- {{276, 35},{ 23,492},{476,423},{123,98}}, |
- {{783,121},{723,139},{ 78,528},{123,98}}, |
- {{723,221},{623, 98},{734,683},{123,98}}, |
- {{ 60,421},{523,132},{364,753},{123,98}}, |
- {{100,521},{423,432},{633,623},{123,98}}, |
- {{ 23,371},{323,599},{343,533},{123,98}}, |
- {{123,123},{123, 0},{343,403},{123,98}}, |
- {{253,321},{490, 32},{347,393},{123,98}}, |
- {{ 68,321},{260,272},{674,283},{123,98}}, |
- {{500,321},{245,373},{ 98,173},{123,98}}, |
- {{423,321},{198,532},{306, 63},{123,98}}, |
- {{197,321},{203,432},{307,443},{123,98}}, |
- {{143,321},{293,132},{334,393},{123,98}} |
-}; |
-#define STEPWIDTH 0.01 /* draws 1/STEPWIDTH +1 points between SP and EP */ |
-#define XSIZE 800 |
-#define YSIZE 600 |
- |
-char screen[YSIZE][XSIZE]; |
-int xco[4],yco[4]; |
- |
-void init() |
-{ /*FB1*/PWCET_Automatic_Ipoint( 3157); /*FB2*/{ |
- int y,x; |
- |
- |
- { /*forx1*/for (x = 0; x < XSIZE;x++) { /*forx2*/PWCET_Automatic_Ipoint( 3158); /*forx3*/{ |
- { /*forx1*/for (y = 0;y < YSIZE;y++) { /*forx2*/PWCET_Automatic_Ipoint( 3159); /*forx3*/{ |
- screen[y][x] = 255; |
- } } /*forx4*/PWCET_Automatic_Ipoint( 3160); /*forx5*/ } /*forx6*/ |
- } } /*forx4*/PWCET_Automatic_Ipoint( 3161); /*forx5*/ } /*forx6*/ |
- |
-}PWCET_Automatic_Ipoint( 3162); /*FB3*/} /*FB4*/ |
- |
-void rand_init() |
-{ /*FB1*/PWCET_Automatic_Ipoint( 33519); /*FB2*/{ |
- int i,j,x,y; |
- |
- |
- |
- { /*forx1*/for (i=0;i<20;i++) |
- { /*forx1*/ { /*forx2*/PWCET_Automatic_Ipoint( 33520); /*forx3*/for (j=0;j<4;j++) { /*forx2*/PWCET_Automatic_Ipoint( 33521); /*forx3*/{ |
- x=rand()%XSIZE; |
- y=rand()%YSIZE; |
- data[i][j][0]=x; |
- data[i][j][1]=y; |
- } } /*forx4*/PWCET_Automatic_Ipoint( 33522); /*forx5*/ } /*forx6*/ } /*forx4*/PWCET_Automatic_Ipoint( 33523); /*forx5*/ } /*forx6*/ |
- |
- |
-}PWCET_Automatic_Ipoint( 33524); /*FB3*/} /*FB4*/ |
- |
-void pepe(){ /*FB1*/PWCET_Automatic_Ipoint( 64662); /*FB2*/{ |
- int a; |
- |
- a=a+2; |
- }PWCET_Automatic_Ipoint( 64663); /*FB3*/} /*FB4*/ |
- |
-int bezier() |
-{ /*FB1*/PWCET_Automatic_Ipoint( 23955); /*FB2*/{ |
- int i,y,x; |
- float k; |
- init(); |
- |
- { /*forx1*/for (i = 0;i < curveno;i++) { /*forx2*/PWCET_Automatic_Ipoint( 23956); /*forx3*/{ |
- xco[3] = data[i][0][0]; |
- yco[3] = data[i][0][1]; |
- xco[2] = 3*(data[i][2][0] - data[i][0][0]); |
- yco[2] = 3*(data[i][2][1] - data[i][0][1]); |
- xco[1] = 3*(data[i][3][0] - data[i][2][0]) - xco[2]; |
- yco[1] = 3*(data[i][3][1] - data[i][2][1]) - yco[2]; |
- xco[0] = data[i][1][0] - data[i][0][0] - xco[2]- xco[1]; |
- yco[0] = data[i][1][1] - data[i][0][1] - yco[2]- yco[1]; |
- |
- |
- { /*forx1*/for (k = 0;k <=1;k+=0.01) { /*forx2*/PWCET_Automatic_Ipoint( 23957); /*forx3*/{ |
- x = (int)(((float)xco[0]*k*k*k)+((float)xco[1]*k*k)+((float)xco[2]*k)+(float)xco[3]); |
- y = (int)(((float)yco[0]*k*k*k)+((float)yco[1]*k*k)+((float)yco[2]*k)+(float)yco[3]); |
- if ((x < XSIZE)&&(x > 0)&&(y < YSIZE)&&(y > 0)) { /*if1*/ PWCET_Automatic_Ipoint( 23958); /*if2*/ { |
- |
- screen[y][x] = 0; |
- } } /*if3*/ PWCET_Automatic_Ipoint( 23959); /*ifxxx2*/ |
- } } /*forx4*/PWCET_Automatic_Ipoint( 23960); /*forx5*/ } /*forx6*/ |
- } } /*forx4*/PWCET_Automatic_Ipoint( 23961); /*forx5*/ } /*forx6*/ |
- if (1==0) { /*if1*/ PWCET_Automatic_Ipoint( 23962); /*if2*/ { |
- k++; |
- pepe(); |
- } } /*if3*/ PWCET_Automatic_Ipoint( 23963); /*ifxxx2*/ |
- |
- |
- { /*returnE1*/PWCET_Automatic_Ipoint( 23964); /*returnE2*/return 0; } /*returnE3*/ |
-}PWCET_Automatic_Ipoint( 23965); /*FB3*/} /*FB4*/ |
- |
- |
-int instrumented_function(){ /*FB1*/PWCET_Automatic_Ipoint( 18549); /*FB2*/{ |
- |
- rand_init(); |
- bezier(); |
- { /*returnE1*/PWCET_Automatic_Ipoint( 18550); /*returnE2*/return 0; } /*returnE3*/ |
-}PWCET_Automatic_Ipoint( 18551); /*FB3*/} /*FB4*/ |
Index: rel_1_5_3/newtrace/instr/makefile |
=================================================================== |
--- rel_1_5_3/newtrace/instr/makefile (revision 1614) |
+++ rel_1_5_3/newtrace/instr/makefile (nonexistent) |
@@ -1,17 +0,0 @@ |
-# |
-# |
-# |
- |
-ifndef BASE |
-BASE=../../.. |
-endif |
-include $(BASE)/config/config.mk |
- |
-PROGS = instr |
- |
-include $(BASE)/config/example.mk |
- |
-instr: |
- make -f $(SUBMAKE) BASE=$(BASE) APP=instr INIT= OTHEROBJS="initfile.o bezier.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __NET__" |
- #make -f $(SUBMAKE) BASE=$(BASE) APP=instr INIT= OTHEROBJS="initfile.o bezier_i.o" OTHERINCL= SHARKOPT="__LINUXC26__ __PCI__ __INPUT__ __NET__ |
- |
Index: rel_1_5_3/newtrace/instr/instr.c |
=================================================================== |
--- rel_1_5_3/newtrace/instr/instr.c (revision 1614) |
+++ rel_1_5_3/newtrace/instr/instr.c (nonexistent) |
@@ -1,168 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-/* The tracer instrumentation ideas come from the York PWCET analisys tool |
- * |
- * Real-Time System Group |
- * University of York |
- * |
- */ |
- |
-#include <kernel/kern.h> |
-#include <time.h> |
-#include <tracer.h> |
- |
-#define PWCET_Automatic_Ipoint(a) TRACER_LOGEVENT(FTrace_EVT_ipoint,(a),0); |
- |
-extern int instrumented_function(); |
- |
-TASK ext_call(void) |
-{ |
- |
- while(1) { |
- |
- instrumented_function(); |
- |
- task_testcancel(); |
- task_endcycle(); |
- |
- } |
- |
- return 0; |
- |
-} |
- |
-#define TASKMAX 4 |
-#define TASKDELAY 1000000 |
-#define TASKDELAY_DELTA 100000 |
- |
-int exec_code() { |
- |
- int num; |
- struct timespec t; |
- |
- HARD_TASK_MODEL m; |
- PID p; |
- |
- clear(); |
- |
- cprintf("Start"); |
- |
- hard_task_default_model(m); |
- hard_task_def_mit(m,200000 + rand() % 100000); |
- hard_task_def_wcet(m,40000); |
- hard_task_def_group(m,2); |
- |
- num = 0; |
- |
- while(num < TASKMAX) { |
- |
- cprintf("."); |
- |
- p = task_create("Instr",ext_call,&m,NULL); |
- if (p == -1) { |
- sys_shutdown_message("Could not create task <instr> ..."); |
- exit(1); |
- } |
- |
- num++; |
- task_activate(p); |
- |
- usleep(TASKDELAY + rand() % TASKDELAY_DELTA); |
- |
- } |
- |
- do { |
- sys_gettime(&t); |
- } while (t.tv_sec < 12); |
- |
- cprintf("End\n"); |
- |
- return 0; |
- |
-} |
- |
-extern unsigned int clk_per_msec; |
- |
-int main(int argc, char **argv) |
-{ |
- |
- int a,b,c,i; |
- struct timespec t,start,end,diff; |
- |
- srand(sys_gettime(NULL)); |
- |
- a = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
- b = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN); |
- c = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
- |
- FTrace_chunk_link(a,b); |
- FTrace_chunk_link(b,c); |
- |
- FTrace_actual_chunk_select(a); |
- |
- kern_gettime(&start); |
- FTrace_enable(); |
- |
- TRACER_LOGEVENT(FTrace_EVT_trace_start,proc_table[exec_shadow].context,clk_per_msec); |
- |
- for (i=0;i<10;i++) |
- if (proc_table[i].context != 0) TRACER_LOGEVENT(FTrace_EVT_id, |
- (unsigned short int)proc_table[i].context,i); |
- |
- exec_code(); |
- |
- TRACER_LOGEVENT(FTrace_EVT_trace_stop,0,0); |
- |
- FTrace_disable(); |
- kern_gettime(&end); |
- |
- SUBTIMESPEC(&end,&start,&diff); |
- |
- printf_xy(1,21,WHITE,"Logged Time %d s %d us",(int)diff.tv_sec,(int)diff.tv_nsec/1000); |
- |
- group_kill(2); |
- |
- do { |
- sys_gettime(&t); |
- } while (t.tv_sec < 12); |
- |
- FTrace_OSD_init_udp(1, "192.168.0.15", "192.168.0.12"); |
- |
- FTrace_send_chunk(a, 0, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
- |
- return 0; |
- |
-} |
- |
Index: rel_1_5_3/newtrace/instr/bezier.c |
=================================================================== |
--- rel_1_5_3/newtrace/instr/bezier.c (revision 1614) |
+++ rel_1_5_3/newtrace/instr/bezier.c (nonexistent) |
@@ -1,127 +0,0 @@ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <kernel/kern.h> |
-#include <tracer.h> |
- |
-#define PWCET_Automatic_Ipoint(a) TRACER_LOGEVENT(FTrace_EVT_ipoint,(a),0); |
- |
-/* here are the bezier curves defined |
-format: |
-{startpoint, endpoint, controlpoint1, controlpoint} |
-. |
-. |
-. */ |
-int curveno = 20; |
-int data[20][4][2] = { |
- {{123,321},{ 23,432},{345,120},{123, 98}}, |
- {{567, 31},{ 23, 24},{ 35,421},{123,398}}, |
- {{ 0, 21},{623,532},{145,323},{153, 68}}, |
- {{253,321},{ 23,432},{745,525},{423,198}}, |
- {{123,456},{ 23,482},{ 0,123},{123,128}}, |
- {{322, 21},{223,232},{ 45,224},{123,98}}, |
- {{423, 32},{123,332},{144,329},{123,98}}, |
- {{276, 35},{ 23,492},{476,423},{123,98}}, |
- {{783,121},{723,139},{ 78,528},{123,98}}, |
- {{723,221},{623, 98},{734,683},{123,98}}, |
- {{ 60,421},{523,132},{364,753},{123,98}}, |
- {{100,521},{423,432},{633,623},{123,98}}, |
- {{ 23,371},{323,599},{343,533},{123,98}}, |
- {{123,123},{123, 0},{343,403},{123,98}}, |
- {{253,321},{490, 32},{347,393},{123,98}}, |
- {{ 68,321},{260,272},{674,283},{123,98}}, |
- {{500,321},{245,373},{ 98,173},{123,98}}, |
- {{423,321},{198,532},{306, 63},{123,98}}, |
- {{197,321},{203,432},{307,443},{123,98}}, |
- {{143,321},{293,132},{334,393},{123,98}} |
-}; |
-#define STEPWIDTH 0.01 /* draws 1/STEPWIDTH +1 points between SP and EP */ |
-#define XSIZE 800 |
-#define YSIZE 600 |
- |
-char screen[YSIZE][XSIZE]; |
-int xco[4],yco[4]; |
- |
-int init() |
-{ |
- int y,x; |
- |
- /*initialize screen*/ |
- for (x = 0;x < XSIZE;x++) { |
- for (y = 0;y < YSIZE;y++) { |
- screen[y][x] = 255; /*white*/ |
- } |
- } |
- |
- return 0; |
- |
-} |
- |
-void rand_init() |
-{ |
- int i,j,x,y; |
- for (i=0;i<20;i++) |
- for (j=0;j<4;j++) { |
- x=rand()%800; |
- y=rand()%600; |
- data[i][j][0]=x; |
- data[i][j][1]=y; |
- } |
-} |
- |
-int bezier() |
-{ |
- |
- int i,y,x; |
- float k; |
- |
- init(); |
- |
- for (i = 0;i < curveno;i++) { |
- xco[3] = data[i][0][0]; |
- yco[3] = data[i][0][1]; |
- xco[2] = 3*(data[i][2][0] - data[i][0][0]); |
- yco[2] = 3*(data[i][2][1] - data[i][0][1]); |
- xco[1] = 3*(data[i][3][0] - data[i][2][0]) - xco[2]; |
- yco[1] = 3*(data[i][3][1] - data[i][2][1]) - yco[2]; |
- xco[0] = data[i][1][0] - data[i][0][0] - xco[2]- xco[1]; |
- yco[0] = data[i][1][1] - data[i][0][1] - yco[2]- yco[1]; |
- |
- /*scan curve for t = 0 to t = 1 with STEPWIDTH*/ |
- for (k = 0;k <=1;k+=STEPWIDTH) { /* PAN_FIXED_LOOP PAN_VARPATH */ |
- x = (int)(((float)xco[0]*k*k*k)+((float)xco[1]*k*k)+((float)xco[2]*k)+(float)xco[3]); |
- y = (int)(((float)yco[0]*k*k*k)+((float)yco[1]*k*k)+((float)yco[2]*k)+(float)yco[3]); |
- if ((x < XSIZE)&&(x > 0)&&(y < YSIZE)&&(y > 0)) { |
- /*write dot to screen*/ |
- screen[y][x] = 0; /*black*/ |
- } |
- } |
- } |
- |
- return 0; |
-} |
- |
-int instrumented_function() { |
- |
- rand_init(); |
- |
- bezier(); |
- |
- return 0; |
-} |
- |
Index: rel_1_5_3/newtrace/instr/initfile.c |
=================================================================== |
--- rel_1_5_3/newtrace/instr/initfile.c (revision 1614) |
+++ rel_1_5_3/newtrace/instr/initfile.c (nonexistent) |
@@ -1,153 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
- * |
- * Authors : |
- * Mauro Marinoni <mauro.marinoni@unipv.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * (see authors.txt for full list of hartik's authors) |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://hartik.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- */ |
- |
- |
-#include <kernel/kern.h> |
- |
-#include "edf/edf/edf.h" |
-#include "cbs/cbs/cbs.h" |
-#include "rr/rr/rr.h" |
-#include "dummy/dummy/dummy.h" |
-#include "intdrive/intdrive/intdrive.h" |
- |
-#include "sem/sem/sem.h" |
-#include "hartport/hartport/hartport.h" |
- |
-#include <drivers/shark_linuxc26.h> |
-#include <drivers/shark_pci26.h> |
-#include <drivers/shark_input26.h> |
-#include <drivers/shark_keyb26.h> |
- |
-/*+ sysyem tick in us +*/ |
-#define TICK 0 |
- |
-/*+ RR tick in us +*/ |
-#define RRTICK 10000 |
- |
-/*+ Interrupt Server +*/ |
-#define INTDRIVE_Q 1000 |
-#define INTDRIVE_U 0.1*MAX_BANDWIDTH |
-#define INTDRIVE_FLAG 0 |
- |
-void call_shutdown_task(void *arg); |
-int device_drivers_init(); |
-int device_drivers_close(); |
-void set_shutdown_task(); |
-TASK shutdown_task_body(void *arg); |
- |
-PID shutdown_task_PID = 1; |
- |
-TIME __kernel_register_levels__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- LEVEL EDF_level; |
- |
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG); |
- EDF_level = EDF_register_level(EDF_ENABLE_ALL); |
- CBS_register_level(CBS_ENABLE_ALL, EDF_level); |
- RR_register_level(RRTICK, RR_MAIN_YES, mb); |
- dummy_register_level(); |
- |
- SEM_register_module(); |
- |
- return TICK; |
-} |
- |
-int device_drivers_close() { |
- |
- return 0; |
- |
-} |
- |
-int device_drivers_init() { |
- |
- LINUXC26_register_module(TRUE); |
- PCI26_init(); |
- |
- return 0; |
-} |
- |
-TASK shutdown_task_body(void *arg) { |
- |
- device_drivers_close(); |
- sys_shutdown_message("-- S.Ha.R.K. Closed --\n"); |
- |
- return NULL; |
-} |
- |
-#define SHUTDOWN_TIMEOUT_SEC 3 |
- |
-void set_shutdown_task() { |
- |
- NRT_TASK_MODEL nrt; |
- |
- nrt_task_default_model(nrt); |
- nrt_task_def_system(nrt); |
- |
- shutdown_task_PID = task_create("Shutdown Task", shutdown_task_body, &nrt, NULL); |
- if (shutdown_task_PID == NIL) { |
- sys_shutdown_message("Error: Cannot create shutdown task\n"); |
- exit(1); |
- } |
- |
-} |
- |
-void call_shutdown_task(void *arg) { |
- |
- struct timespec t; |
- |
- sys_gettime(&t); |
- t.tv_sec += SHUTDOWN_TIMEOUT_SEC; |
- |
- /* Emergency timeout to exit from RUNLEVEL_SHUTDOWN */ |
- kern_event_post(&t,(void *)((void *)sys_abort_shutdown),(void *)0); |
- |
- task_activate(shutdown_task_PID); |
-} |
- |
-TASK __init__(void *arg) |
-{ |
- struct multiboot_info *mb = (struct multiboot_info *)arg; |
- |
- HARTPORT_init(); |
- |
- set_shutdown_task(); |
- |
- device_drivers_init(); |
- |
- sys_atrunlevel(call_shutdown_task, NULL, RUNLEVEL_SHUTDOWN); |
- |
- __call_main__(mb); |
- |
- return (void *)0; |
-} |
Index: rel_1_5_3/newtrace/utils/extract.c |
=================================================================== |
--- rel_1_5_3/newtrace/utils/extract.c (revision 1614) |
+++ rel_1_5_3/newtrace/utils/extract.c (nonexistent) |
@@ -1,1131 +0,0 @@ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
-#include <stdio.h> |
-#include <stdlib.h> |
-#include <math.h> |
-#include <unistd.h> |
-#include <string.h> |
- |
-#define MAXCONTEXT 100 |
-#define MAXJOB 300000 |
- |
-#define INT_CTX 1 |
-#define INT_PID 9999 |
-#define PID_NO_DEF -1 |
-#define SERVER_NO_DEF -1 |
- |
-#define BACKGROUND 0 |
-#define PERIODICAL 1 |
-#define INTERRUPT 2 |
- |
-#define DRAW_NUM 1000 |
- |
-#define DISABLE_PLOT |
- |
-struct ctx_exec { |
- int ctx; |
- unsigned long long dtsc; |
- unsigned long long dnsec; |
- unsigned long long tsc_start; |
- unsigned long long nsec_start; |
-}; |
- |
-struct ctx_to_pid { |
- int ctx; |
- int pid; |
-}; |
- |
-struct ctx_server { |
- int ctx; |
- int server_id; |
- |
-}; |
- |
-struct task_event { |
- int ctx; |
- unsigned long long tsc; |
- unsigned long long nsec; |
-}; |
- |
-struct server_event { |
- int server_id; |
- unsigned long long tsc; |
- unsigned long long nsec; |
-}; |
- |
-void Error(int num, int line) { |
- printf("Finite-State machine error %d at line %d\n",num,line); |
- exit(2); |
-} |
- |
-int context_total = 0,endcycle_total = 0,job_total = 0,exec_total = 0; |
-struct ctx_exec *exec_list; |
-struct ctx_to_pid *context_list; |
-struct task_event *endcycle_list; |
-struct task_event *deadline_miss_list; |
-struct task_event *wcet_miss_list; |
-struct task_event *act_list; |
-struct ctx_exec *job_list; |
-struct ctx_server *ctx_server_list; |
- |
-int server_exec_total = 0, server_end_total=0, server_act_total=0, ctx_server_total = 0, server_total=0; |
-struct server_event *act_server_list; |
-struct server_event *server_budget_end_list; |
- |
-int deadline_miss = 0, wcet_miss = 0, act_total = 0; |
- |
-unsigned int clk_per_msec = 0; |
-unsigned int skip_clk_per_msec = 0; |
- |
-unsigned long long log_start_tsc = 0; |
-unsigned long long log_end_tsc = 0; |
-unsigned long long total_tsc = 0; |
-unsigned long long total_nsec = 0; |
- |
-/* Data for gnuplot external call */ |
-int draw_data[DRAW_NUM+1]; |
- |
-int gnuplot_clear() { |
- |
- int i; |
- |
- for (i=0;i<DRAW_NUM;i++) |
- draw_data[i] = 0; |
- |
- return 0; |
- |
-} |
- |
-int gnuplot_draw(char *title,unsigned long long max_limit,int type) { |
- |
-#ifndef DISABLE_PLOT |
- |
- FILE *gnuplot_data, *gnuplot_command; |
- char temp_name[30]; |
- int i,pid,*current_mem; |
- |
- current_mem = malloc(sizeof(int)*(DRAW_NUM+1)); |
- memcpy(current_mem,draw_data,sizeof(int)*(DRAW_NUM+1)); |
- |
- pid = fork(); |
- if (pid == 0) { |
- |
- srand(getpid()); |
- |
- sprintf(temp_name,"/tmp/pwcet%d",rand()%10000); |
- |
- gnuplot_data = fopen(temp_name,"w"); |
- gnuplot_command = popen("gnuplot -persist","w"); |
- |
- for (i=0;i<DRAW_NUM;i++) |
- fprintf(gnuplot_data,"%f\t%f\n",(double)i * (double)max_limit / (double)DRAW_NUM / 1000.0,(float)(current_mem[i])); |
- |
- fflush(gnuplot_data); |
- fclose(gnuplot_data); |
- |
- fprintf(gnuplot_command,"set xlabel \"Time [us]\"\n"); |
- if (type == 0) { |
- fprintf(gnuplot_command,"set ylabel \"Frequency [#]\"\n"); |
- |
- fprintf(gnuplot_command,"plot \"%s\" using 1:2 title \"%s\" with lines\n",temp_name,title); |
- fflush(gnuplot_command); |
- } else { |
- fprintf(gnuplot_command,"set ylabel \"Time [us]\"\n"); |
- |
- fprintf(gnuplot_command,"plot \"%s\" using 1:2 title \"%s\" with lines\n",temp_name,title); |
- fflush(gnuplot_command); |
- } |
- |
- pclose(gnuplot_command); |
- exit(0); |
- |
- } |
- |
-#endif |
- |
- return 0; |
- |
-} |
- |
-int stats_from_execs(int ctx_num, unsigned long long *tot_nsec, |
- unsigned long long *min_nsec, |
- unsigned long long *mean_nsec, |
- unsigned long long *max_nsec, |
- unsigned long long *first_nsec, |
- int *number) { |
- |
- unsigned long long temp_nsec; |
- int k,i; |
- |
- temp_nsec = 0; |
- *max_nsec = 0; |
- *mean_nsec = 0; |
- *min_nsec = 0xFFFFFFFF; |
- *first_nsec = 0; |
- k = 0; |
- for (i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == context_list[ctx_num].ctx) { |
- if (*first_nsec == 0) *first_nsec = exec_list[i].nsec_start; |
- if (exec_list[i].dnsec > *max_nsec) *max_nsec = exec_list[i].dnsec; |
- if (exec_list[i].dnsec < *min_nsec) *min_nsec = exec_list[i].dnsec; |
- temp_nsec += exec_list[i].dnsec; |
- k++; |
- } |
- |
- *number = k; |
- *tot_nsec = temp_nsec; |
- if (k != 0) *mean_nsec = temp_nsec / k; |
- |
- return 0; |
- |
-} |
- |
-int stats_from_jobs(int ctx_num, unsigned long long *tot_nsec, |
- unsigned long long *min_nsec, |
- unsigned long long *mean_nsec, |
- unsigned long long *max_nsec, |
- unsigned long long *first_nsec, |
- int *number) { |
- |
- unsigned long long temp_nsec; |
- int k,i; |
- |
- temp_nsec = 0; |
- *max_nsec = 0; |
- *mean_nsec = 0; |
- *min_nsec = 0xFFFFFFFF; |
- *first_nsec = 0; |
- k = 0; |
- for (i=0;i<job_total;i++) |
- if (job_list[i].ctx == context_list[ctx_num].ctx) { |
- if (*first_nsec == 0) *first_nsec = job_list[i].nsec_start; |
- if (job_list[i].dnsec > *max_nsec) *max_nsec = job_list[i].dnsec; |
- if (job_list[i].dnsec < *min_nsec) *min_nsec = job_list[i].dnsec; |
- temp_nsec += job_list[i].dnsec; |
- k++; |
- } |
- |
- *number = k; |
- *tot_nsec = temp_nsec; |
- if (k != 0) *mean_nsec = temp_nsec / k; |
- |
- return 0; |
- |
-} |
- |
-int arr_stats_from_execs(int ctx_num, unsigned long long *min_nsec, |
- unsigned long long *mean_nsec, |
- unsigned long long *max_nsec) { |
- |
- unsigned long long last_start,temp_nsec,delta_start; |
- int i,k; |
- |
- last_start = 0; |
- temp_nsec = 0; |
- *max_nsec = 0; |
- *min_nsec = 0xFFFFFFFF; |
- *mean_nsec = 0; |
- k = 0; |
- for (i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == context_list[ctx_num].ctx) { |
- if (last_start == 0) { |
- last_start = exec_list[i].nsec_start; |
- } else { |
- delta_start = exec_list[i].nsec_start - last_start; |
- if (delta_start > *max_nsec) *max_nsec = delta_start; |
- if (delta_start < *min_nsec) *min_nsec = delta_start; |
- temp_nsec += delta_start; |
- k++; |
- last_start = exec_list[i].nsec_start; |
- } |
- } |
- |
- if (k != 0) *mean_nsec = temp_nsec / k; |
- |
- return 0; |
- |
-} |
- |
-int arr_stats_from_jobs(int ctx_num, unsigned long long *min_nsec, |
- unsigned long long *mean_nsec, |
- unsigned long long *max_nsec) { |
- |
- unsigned long long last_start,temp_nsec,delta_start; |
- int i,k; |
- |
- last_start = 0; |
- temp_nsec = 0; |
- *max_nsec = 0; |
- *min_nsec = 0xFFFFFFFF; |
- *mean_nsec = 0; |
- k = 0; |
- for (i=0;i<job_total;i++) |
- if (job_list[i].ctx == context_list[ctx_num].ctx) { |
- if (last_start == 0) { |
- last_start = job_list[i].nsec_start; |
- } else { |
- delta_start = job_list[i].nsec_start - last_start; |
- if (delta_start > *max_nsec) *max_nsec = delta_start; |
- if (delta_start < *min_nsec) *min_nsec = delta_start; |
- temp_nsec += delta_start; |
- k++; |
- last_start = job_list[i].nsec_start; |
- } |
- } |
- |
- if (k != 0) *mean_nsec = temp_nsec / k; |
- |
- return 0; |
- |
-} |
- |
-int plot_exec_demand_function(int ctx_num, char *pidstr) { |
- |
- unsigned long long max_limit; |
- char tmpstr[50]; |
- int i; |
- |
- gnuplot_clear(); |
- |
- max_limit = total_nsec; |
- |
- for (i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == context_list[ctx_num].ctx) { |
- int h1,h2,h3; |
- |
- h1 = exec_list[i].nsec_start * DRAW_NUM / max_limit; |
- h2 = (exec_list[i].nsec_start+exec_list[i].dnsec) * DRAW_NUM / max_limit; |
- for (h3=h1;h3<h2;h3++) |
- if (h3 <= DRAW_NUM) draw_data[h3] += exec_list[i].dnsec/1000*(h3-h1)/(h2-h1); |
- for (h3=h2;h3<=DRAW_NUM;h3++) |
- if (h3 <= DRAW_NUM) draw_data[h3] += exec_list[i].dnsec/1000; |
- |
- } |
- |
- sprintf(tmpstr,"Ctx [%d:%s] Demand-Function",context_list[ctx_num].ctx,pidstr); |
- gnuplot_draw(tmpstr,max_limit,1); |
- |
- return 0; |
- |
-} |
- |
-int plot_exec_c_distrib(int ctx_num, unsigned long long max_nsec, char *pidstr) { |
- |
- unsigned long long max_limit; |
- char tmpstr[50]; |
- int i,h; |
- |
- if (max_nsec == 0) return 0; |
- |
- gnuplot_clear(); |
- |
- max_limit = max_nsec; |
- |
- for (i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == context_list[ctx_num].ctx) { |
- h = exec_list[i].dnsec * DRAW_NUM / max_limit; |
- if (h <= DRAW_NUM) draw_data[h]++; |
- } |
- |
- sprintf(tmpstr,"Ctx [%d:%s] Exec C-dist",context_list[ctx_num].ctx,pidstr); |
- gnuplot_draw(tmpstr,max_limit,0); |
- |
- return 0; |
- |
-} |
- |
-int plot_job_c_distrib(int ctx_num, unsigned long long max_nsec, char *pidstr) { |
- |
- unsigned long long max_limit; |
- char tmpstr[50]; |
- int i,h; |
- |
- if (max_nsec == 0) return 0; |
- |
- gnuplot_clear(); |
- |
- max_limit = max_nsec; |
- |
- for (i=0;i<job_total;i++) |
- if (job_list[i].ctx == context_list[ctx_num].ctx) { |
- h = job_list[i].dnsec * DRAW_NUM / max_limit; |
- if (h <= DRAW_NUM) draw_data[h]++; |
- } |
- |
- sprintf(tmpstr,"Ctx [%d:%s] Job C-dist",context_list[ctx_num].ctx,pidstr); |
- gnuplot_draw(tmpstr,max_limit,0); |
- |
- return 0; |
- |
-} |
- |
-int plot_exec_arr_distrib(int ctx_num, unsigned long long max_nsec, char *pidstr) { |
- |
- unsigned long long max_limit,last_start,delta_start; |
- char tmpstr[50]; |
- int i,h; |
- |
- if (max_nsec == 0) return 0; |
- |
- gnuplot_clear(); |
- |
- max_limit = max_nsec; |
- |
- last_start = 0; |
- for (i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == context_list[ctx_num].ctx) { |
- if (last_start == 0) { |
- last_start = exec_list[i].nsec_start; |
- } else { |
- delta_start = exec_list[i].nsec_start - last_start; |
- |
- h = delta_start * DRAW_NUM / max_limit; |
- if (h <= DRAW_NUM) draw_data[h]++; |
- |
- last_start = exec_list[i].nsec_start; |
- } |
- } |
- |
- sprintf(tmpstr,"Ctx [%d:%s] Exec Arr.Delta",context_list[ctx_num].ctx,pidstr); |
- gnuplot_draw(tmpstr,max_limit,0); |
- |
- return 0; |
- |
-} |
- |
-int plot_job_arr_distrib(int ctx_num, unsigned long long max_nsec, char *pidstr) { |
- |
- unsigned long long max_limit,last_start,delta_start; |
- char tmpstr[50]; |
- int i,h; |
- |
- if (max_nsec == 0) return 0; |
- |
- gnuplot_clear(); |
- |
- max_limit = max_nsec; |
- |
- last_start = 0; |
- for (i=0;i<job_total;i++) |
- if (job_list[i].ctx == context_list[ctx_num].ctx) { |
- if (last_start == 0) { |
- last_start = job_list[i].nsec_start; |
- } else { |
- delta_start = job_list[i].nsec_start - last_start; |
- |
- h = delta_start * DRAW_NUM / max_limit; |
- if (h <= DRAW_NUM) draw_data[h]++; |
- |
- last_start = job_list[i].nsec_start; |
- } |
- } |
- |
- sprintf(tmpstr,"Ctx [%d:%s] Job Arr.Delta",context_list[ctx_num].ctx,pidstr); |
- gnuplot_draw(tmpstr,max_limit,0); |
- |
- return 0; |
- |
-} |
- |
-int create_lists(char *filename) { |
- |
- FILE *input_file; |
- |
- int type,par1,par2,k,i,state; |
- |
- int current_context = 0; |
- int current_exec = 0; |
- int current_endcycle = 0; |
- |
- int kill_delta = 0; |
- |
- unsigned long long last_tsc, tsc; |
- unsigned long long current_nsec = 0; |
- |
- input_file = fopen(filename,"r"); |
- |
- /* Memory alloc */ |
- exec_list = malloc(sizeof(struct ctx_exec) * MAXJOB); |
- context_list = malloc(sizeof(struct ctx_to_pid) * MAXCONTEXT); |
- ctx_server_list = malloc(sizeof(struct ctx_server) * MAXCONTEXT); |
- |
- endcycle_list = malloc(sizeof(struct task_event) * MAXJOB); |
- deadline_miss_list = malloc(sizeof(struct task_event) * MAXJOB); |
- wcet_miss_list = malloc(sizeof(struct task_event) * MAXJOB); |
- act_list = malloc(sizeof(struct task_event) * MAXJOB); |
- |
- act_server_list = malloc(sizeof(struct server_event) * MAXJOB ); |
- server_budget_end_list = malloc(sizeof(struct server_event) * MAXJOB); |
- |
- |
- /* Finite-State machine |
- * |
- * FS-Machine states: |
- |
- 0 - Start |
- 1 - Context running |
- 2 - Interrupt running |
- |
- 10 - End |
- |
- */ |
- |
- for(i=0;i<MAXCONTEXT;i++) { |
- context_list[i].ctx = 0; |
- context_list[i].pid = PID_NO_DEF; |
- } |
- |
- for(i=0; i<MAXCONTEXT; i++) { |
- ctx_server_list[i].ctx=0; |
- ctx_server_list[i].server_id=SERVER_NO_DEF; |
- |
- } |
- |
- /* The start context + interrupt context */ |
- context_total = 2; |
- current_context = 0; |
- last_tsc = 0; |
- context_list[0].ctx = 0; |
- context_list[0].pid = PID_NO_DEF; |
- context_list[1].ctx = INT_CTX; |
- context_list[1].pid = INT_PID; |
- |
- state = 0; |
- |
- k = 0; |
- while(!feof(input_file)) { |
- |
- fscanf(input_file,"%d %llu",&type,&tsc); |
- k++; |
- |
- switch (type) { |
- |
- case 1: |
- |
- /* No par */ |
- break; |
- |
- case 2: |
- case 3: |
- case 4: |
- case 6: |
- case 7: |
- case 8: |
- case 10: |
- case 11: |
- case 12: |
- case 13: |
- case 14: |
- case 15: |
- /* 1 par */ |
- fscanf(input_file,"%d",&par1); |
- break; |
- |
- case 5: |
- case 9: |
- case 0: |
- case 16: |
- case 17: |
- case 20: |
- case 21: |
- |
- /* 2 par */ |
- fscanf(input_file,"%d %d",&par1,&par2); |
- break; |
- |
- } |
- |
- switch (type) { |
- |
- case 0: |
- if (state != 0) Error(1,k); |
- printf("EVT:Log starts at [%12llu]\n",tsc); |
- last_tsc = tsc; |
- log_start_tsc = tsc; |
- current_nsec = 0; |
- |
- if (par1 == 0) Error(11,k); |
- if (par2 == 0) Error(12,k); |
- |
- current_context = par1; |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- if (i == context_total) { |
- context_list[context_total].ctx = par1; |
- context_total++; |
- } |
- |
- clk_per_msec = par2; |
- |
- exec_list[current_exec].tsc_start = tsc; |
- exec_list[current_exec].nsec_start = current_nsec; |
- state = 1; |
- break; |
- |
- case 1: |
- printf("EVT:Log ends at [%12llu]\n",tsc); |
- exec_list[current_exec].dtsc = tsc - last_tsc; |
- exec_list[current_exec].dnsec = exec_list[current_exec].dtsc * 1000000 / clk_per_msec; |
- current_nsec += exec_list[current_exec].dnsec; |
- exec_list[current_exec].ctx = current_context; |
- current_exec++; |
- last_tsc = tsc; |
- log_end_tsc = tsc; |
- total_nsec = current_nsec; |
- state = 10; |
- break; |
- |
- /* Int start */ |
- case 2: |
- if (state == 0) Error(2,k); |
- exec_list[current_exec].dtsc = tsc - last_tsc; |
- exec_list[current_exec].dnsec = exec_list[current_exec].dtsc * 1000000 / clk_per_msec; |
- current_nsec += exec_list[current_exec].dnsec; |
- exec_list[current_exec].ctx = current_context; |
- current_exec++; |
- last_tsc = tsc; |
- current_context = INT_CTX; |
- exec_list[current_exec].tsc_start = tsc - log_start_tsc; |
- exec_list[current_exec].nsec_start = current_nsec; |
- state = 2; |
- break; |
- |
- /* Int end */ |
- case 3: |
- if (state != 2) Error(3,k); |
- exec_list[current_exec].dtsc = tsc - last_tsc; |
- exec_list[current_exec].dnsec = exec_list[current_exec].dtsc * 1000000 / clk_per_msec; |
- current_nsec += exec_list[current_exec].dnsec; |
- exec_list[current_exec].ctx = current_context; |
- current_exec++; |
- last_tsc = tsc; |
- if (par1 > 16) { |
- current_context = par1; |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- if (i == context_total) { |
- context_list[context_total].ctx = par1; |
- context_total++; |
- } |
- } |
- |
- exec_list[current_exec].tsc_start = tsc; |
- exec_list[current_exec].nsec_start = current_nsec; |
- state = 1; |
- break; |
- |
- /* Change ctx */ |
- case 4: |
- |
- exec_list[current_exec].dtsc = tsc - last_tsc; |
- exec_list[current_exec].dnsec = exec_list[current_exec].dtsc * 1000000 / clk_per_msec; |
- current_nsec += exec_list[current_exec].dnsec; |
- exec_list[current_exec].ctx = current_context; |
- current_exec++; |
- last_tsc = tsc; |
- current_context = par1; |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- if (i == context_total) { |
- context_list[context_total].ctx = par1; |
- context_total++; |
- } |
- |
- exec_list[current_exec].tsc_start = tsc; |
- exec_list[current_exec].nsec_start = current_nsec; |
- state = 1; |
- break; |
- |
- /* Task create */ |
- case 5: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) { |
- context_list[i].pid = par2; |
- break; |
- } |
- if (i == context_total) { |
- context_list[context_total].ctx = par1; |
- context_list[context_total].pid = par2; |
- context_total++; |
- } |
- |
- break; |
- |
- /* Task kill */ |
- case 7: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- if (i == context_total) Error(5,k); |
- else { |
- |
- kill_delta += 1000; |
- |
- for (k=0;k<current_endcycle;k++) |
- if (endcycle_list[k].ctx == par1) |
- endcycle_list[k].ctx += kill_delta; |
- for (k=0;k<current_exec;k++) |
- if (exec_list[k].ctx == par1) |
- exec_list[k].ctx += kill_delta; |
- context_list[context_total].ctx = context_list[i].ctx + kill_delta; |
- context_list[context_total].pid = context_list[i].pid; |
- context_total++; |
- |
- if (current_context == par1) current_context += kill_delta; |
- |
- } |
- |
- break; |
- |
- /* Task endcycle */ |
- case 8: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- if (i == context_total) Error(4,k); |
- |
- endcycle_list[current_endcycle].ctx = par1; |
- endcycle_list[current_endcycle].tsc = tsc; |
- endcycle_list[current_endcycle].nsec = current_nsec + (tsc-last_tsc) * 1000000 / clk_per_msec; |
- current_endcycle++; |
- |
- break; |
- |
- /* Task activate */ |
- case 6: |
- |
- act_list[act_total].ctx = par1; |
- act_list[act_total].tsc = tsc; |
- act_list[act_total].nsec = current_nsec + (tsc-last_tsc) * 1000000 / clk_per_msec; |
- act_total++; |
- |
- break; |
- /* Server Create */ |
- case 16: |
- for (i=0;i<ctx_server_total;i++) |
- if (par1 == ctx_server_list[i].ctx) { |
- ctx_server_list[i].server_id = par2; |
- break; |
- } |
- if (i == ctx_server_total) { |
- ctx_server_list[ctx_server_total].ctx = par1; |
- ctx_server_list[ctx_server_total].server_id = par2; |
- ctx_server_total++; |
- } |
- printf("(%d, %d, %d)", ctx_server_total, par1, par2); |
- break; |
- |
- /* Deadline miss */ |
- case 20: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- //if (i == context_total) Error(4,k); |
- |
- deadline_miss_list[deadline_miss].ctx = par1; |
- deadline_miss_list[deadline_miss].tsc = tsc; |
- deadline_miss_list[deadline_miss].nsec = current_nsec + (tsc-last_tsc) * 1000000 / clk_per_msec; |
- deadline_miss++; |
- |
- break; |
- |
- /* Wcet miss */ |
- case 21: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) break; |
- //if (i == context_total) Error(4,k); |
- |
- wcet_miss_list[wcet_miss].ctx = par1; |
- wcet_miss_list[wcet_miss].tsc = tsc; |
- wcet_miss_list[wcet_miss].nsec = current_nsec + (tsc-last_tsc) * 1000000 / clk_per_msec; |
- wcet_miss++; |
- |
- break; |
- |
- /* Task id */ |
- case 9: |
- |
- for (i=0;i<context_total;i++) |
- if (par1 == context_list[i].ctx) { |
- context_list[i].pid = par2; |
- break; |
- } |
- if (i == context_total) { |
- context_list[context_total].ctx = par1; |
- context_list[context_total].pid = par2; |
- context_total++; |
- } |
- |
- break; |
- |
- case 10: |
- |
- exec_list[current_exec].dtsc = tsc - last_tsc; |
- exec_list[current_exec].dnsec = exec_list[current_exec].dtsc * 1000000 / clk_per_msec; |
- current_nsec += exec_list[current_exec].dnsec; |
- exec_list[current_exec].ctx = current_context; |
- current_exec++; |
- last_tsc = tsc; |
- |
- exec_list[current_exec].tsc_start = tsc; |
- exec_list[current_exec].nsec_start = current_nsec; |
- |
- if (!skip_clk_per_msec) clk_per_msec = par1; |
- |
- break; |
- |
- } |
- |
- if (current_exec == MAXJOB-1) { |
- printf("Too many execs...\n"); |
- exit(3); |
- } |
- |
- if (current_endcycle == MAXJOB-1 || act_total == MAXJOB-1 |
- || deadline_miss == MAXJOB-1 || wcet_miss == MAXJOB-1) { |
- printf("Too many jobs...\n"); |
- exit(4); |
- } |
- |
- if (state == 10) break; |
- |
- } |
- |
- endcycle_total = current_endcycle; |
- exec_total = current_exec; |
- |
- return k; |
- |
-} |
- |
-int task_events(int num, int *act, int *dlinemiss, int *wcetmiss) { |
- |
- unsigned long long i; |
- int tmp = 0; |
- |
- *act = 0; |
- *dlinemiss = 0; |
- *wcetmiss = 0; |
- |
- tmp = 0; |
- for (i=0;i<act_total;i++) |
- if (act_list[i].ctx == context_list[num].ctx) tmp++; |
- *act = tmp; |
- tmp = 0; |
- for (i=0;i<deadline_miss;i++) |
- if (deadline_miss_list[i].ctx == context_list[num].ctx) tmp++; |
- *dlinemiss = tmp; |
- tmp = 0; |
- for (i=0;i<wcet_miss;i++) |
- if (wcet_miss_list[i].ctx == context_list[num].ctx) tmp++; |
- *wcetmiss = tmp; |
- |
- return 0; |
- |
-} |
- |
-int create_job_list() { |
- |
- int current_job = 0, h, i, k; |
- int temp_ctx; |
- unsigned long long temp_nsec, endcycle_start_nsec; |
- unsigned long long temp_tsc, endcycle_end_nsec; |
- |
- job_list = malloc(sizeof(struct ctx_exec) * MAXJOB); |
- |
- for (k=0;k<context_total;k++) { |
- |
- temp_ctx = context_list[k].ctx; |
- endcycle_start_nsec = 0; |
- |
- for (h=0;h<endcycle_total;h++) { |
- |
- if (endcycle_list[h].ctx == temp_ctx) { |
- |
- if (endcycle_start_nsec == 0) |
- endcycle_start_nsec = 0; |
- |
- endcycle_end_nsec = endcycle_list[h].nsec; |
- temp_nsec = 0; |
- temp_tsc = 0; |
- |
- job_list[current_job].nsec_start = 0; |
- |
- for(i=0;i<exec_total;i++) |
- if (exec_list[i].ctx == temp_ctx) { |
- if (exec_list[i].nsec_start < endcycle_end_nsec && |
- exec_list[i].nsec_start >= endcycle_start_nsec) { |
- if (job_list[current_job].nsec_start == 0) |
- job_list[current_job].nsec_start = exec_list[i].nsec_start; |
- temp_nsec += exec_list[i].dnsec; |
- temp_tsc += exec_list[i].dtsc; |
- } |
- } |
- |
- job_list[current_job].dtsc = temp_tsc; |
- job_list[current_job].dnsec = temp_nsec; |
- job_list[current_job].ctx = temp_ctx; |
- current_job++; |
- |
- endcycle_start_nsec = endcycle_end_nsec; |
- |
- } |
- |
- } |
- |
- } |
- |
- job_total = current_job; |
- |
- return 0; |
- |
-} |
- |
-int elaborate_statistics(int num, int task_type) { |
- |
- char pidstr[10]; |
- char serverstr[10]; |
- unsigned long long tot_nsec,mean_nsec,max_nsec,min_nsec,first_nsec; |
- int number,act,dlinemiss,wcetmiss; |
- int i=0; |
- |
- switch (context_list[num].pid) { |
- case PID_NO_DEF: |
- sprintf(pidstr,"NODEF"); |
- break; |
- case INT_PID: |
- sprintf(pidstr," INT"); |
- break; |
- default: |
- sprintf(pidstr,"%5d",context_list[num].pid); |
- break; |
- } |
- |
- for (i=0; i<ctx_server_total; i++) { |
- if (ctx_server_list[i].ctx==context_list[num].ctx) { |
- sprintf(serverstr,"%5d", ctx_server_list[i].server_id); |
- break; |
- } |
- } |
- |
- if (i==ctx_server_total) |
- sprintf(serverstr, "NODEF"); |
- |
- |
- if (task_type == BACKGROUND) { |
- |
- printf("Background Task CTX [%5d] PID [%s] SERVER [%s]\n",context_list[num].ctx,pidstr, serverstr); |
- |
- stats_from_execs(num,&tot_nsec,&min_nsec,&mean_nsec,&max_nsec,&first_nsec,&number); |
- |
- if (number > 0) { |
- |
- printf(" Total Execution [%12llu ns]\n",tot_nsec); |
- printf(" Mean CPU Bandwidth [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec)*100.0,'%'); |
- printf(" after first exec [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec-first_nsec)*100.0,'%'); |
- printf(" Execs Number [%12d ]\n",number); |
- printf(" Min Exec [%12llu ns]\n",min_nsec); |
- printf(" Mean Exec [%12llu ns]\n",mean_nsec); |
- printf(" Max Exec [%12llu ns]\n\n",max_nsec); |
- |
- plot_exec_demand_function(num,pidstr); |
- |
- } else { |
- |
- printf(" Total Execution [%12llu ns]\n\n",tot_nsec); |
- |
- } |
- |
- } |
- |
- if (task_type == INTERRUPT) { |
- |
- printf("Interrupts\n"); |
- |
- stats_from_execs(num,&tot_nsec,&min_nsec,&mean_nsec,&max_nsec,&first_nsec,&number); |
- |
- if (number > 0) { |
- |
- printf(" Total Execution [%12llu ns]\n",tot_nsec); |
- printf(" Mean CPU Bandwidth [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec)*100.0,'%'); |
- printf(" after first int [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec-first_nsec)*100.0,'%'); |
- printf(" Interrupts Number [%12d ]\n",number); |
- printf(" Min Interrupt [%12llu ns]\n",min_nsec); |
- printf(" Mean Interrupt [%12llu ns]\n",mean_nsec); |
- printf(" Max Interrupt [%12llu ns]\n\n",max_nsec); |
- |
- plot_exec_demand_function(num,pidstr); |
- |
- plot_exec_c_distrib(num,max_nsec,pidstr); |
- |
- arr_stats_from_execs(num,&min_nsec,&mean_nsec,&max_nsec); |
- |
- if (max_nsec > 0) { |
- |
- printf(" Min Arr. Delta [%12llu ns]\n",min_nsec); |
- printf(" Mean Arr. Delta [%12llu ns]\n",mean_nsec); |
- printf(" Max Arr. Delta [%12llu ns]\n\n",max_nsec); |
- |
- plot_exec_arr_distrib(num,max_nsec,pidstr); |
- |
- } |
- |
- } else { |
- |
- printf(" Total Execution [%12llu ns]\n\n",tot_nsec); |
- |
- } |
- |
- } |
- |
- if (task_type == PERIODICAL) { |
- |
- printf("Periodical Task CTX [%5d] PID [%s] SERVER [%s]\n",context_list[num].ctx,pidstr,serverstr); |
- |
- stats_from_execs(num,&tot_nsec,&min_nsec,&mean_nsec,&max_nsec,&first_nsec,&number); |
- |
- if (number > 0) { |
- |
- printf(" Total Execution [%12llu ns]\n",tot_nsec); |
- printf(" Mean CPU Bandwidth [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec)*100.0,'%'); |
- printf(" after first exec [%11f%c ]\n",(double)(tot_nsec)/(double)(total_nsec-first_nsec)*100.0,'%'); |
- printf(" Execs Number [%12d ]\n",number); |
- printf(" Min Exec [%12llu ns]\n",min_nsec); |
- printf(" Mean Exec [%12llu ns]\n",mean_nsec); |
- printf(" Max Exec [%12llu ns]\n\n",max_nsec); |
- |
- plot_exec_demand_function(num,pidstr); |
- |
- stats_from_jobs(num,&tot_nsec,&min_nsec,&mean_nsec,&max_nsec,&first_nsec,&number); |
- |
- printf(" Total Job Exec [%12llu ns]\n",tot_nsec); |
- printf(" Jobs Number [%12d ]\n",number); |
- printf(" Min Job [%12llu ns]\n",min_nsec); |
- printf(" Mean Job [%12llu ns]\n",mean_nsec); |
- printf(" Max Job [%12llu ns]\n\n",max_nsec); |
- |
- task_events(num,&act,&dlinemiss,&wcetmiss); |
- |
- printf(" Activations [%12d ]\n",act); |
- printf(" Deadline Miss [%12d ]\n",dlinemiss); |
- printf(" Wcet Miss [%12d ]\n\n",wcetmiss); |
- |
- plot_job_c_distrib(num,max_nsec,pidstr); |
- |
- arr_stats_from_jobs(num,&min_nsec,&mean_nsec,&max_nsec); |
- |
- if (max_nsec > 0) { |
- |
- printf(" Min Arr. Delta [%12llu ns]\n",min_nsec); |
- printf(" Mean Arr. Delta [%12llu ns]\n",mean_nsec); |
- printf(" Max Arr. Delta [%12llu ns]\n\n",max_nsec); |
- |
- plot_job_arr_distrib(num,max_nsec,pidstr); |
- |
- } |
- |
- } else { |
- |
- printf(" Total Execution [%12llu ns]\n\n",tot_nsec); |
- |
- } |
- |
- } |
- |
- return 0; |
- |
-} |
- |
-int main(int argc, char *argv[]) { |
- |
- int events_total,k,i; |
- int task_type; |
- |
- unsigned long long temp_nsec; |
- |
- srand(getpid()); |
- |
- if (argc < 2) { |
- printf("%s: Enter the input file name \"%s filename.pwc [clk_per_msec]\"\n",argv[0],argv[0]); |
- exit(1); |
- } |
- |
- printf("\n"); |
- |
- if (argc == 3) { |
- skip_clk_per_msec = 1; |
- clk_per_msec = atoi(argv[2]); |
- printf("Clk/msec = %u\n\n",clk_per_msec); |
- } |
- |
- events_total = create_lists(argv[1]); |
- |
- total_tsc = log_end_tsc - log_start_tsc; |
- |
- printf("\nTotal dTSC [%12llu] ns [%12llu]\n", total_tsc, total_nsec); |
- printf("Events [%12d]\n",events_total); |
- printf("Execs [%12d]\n",exec_total); |
- printf("EndCycles [%12d]\n",endcycle_total); |
- printf("Dline miss [%12d]\n",deadline_miss); |
- printf("WCET miss [%12d]\n",wcet_miss); |
- |
- printf("\nPreemption Removing.... \n"); |
- |
- /* Remove preemption from the computation time */ |
- create_job_list(); |
- |
- temp_nsec = 0; |
- for (i=0;i<job_total;i++) |
- temp_nsec += job_list[i].dnsec; |
- |
- printf("Total nsec of jobs [%12llu]\n",temp_nsec); |
- |
- temp_nsec = 0; |
- for (i=0;i<exec_total;i++) |
- temp_nsec += exec_list[i].dnsec; |
- |
- printf("Total nsec of exec [%12llu]\n",temp_nsec); |
- printf("Total nsec considering last clk/msec [%12llu]\n",total_tsc*1000000/clk_per_msec); |
- |
- printf("\nCompute Task Statistics.... \n\n"); |
- |
- for (i=0;i<context_total;i++) { |
- |
- task_type = BACKGROUND; |
- |
- if (context_list[i].ctx == INT_CTX) task_type = INTERRUPT; |
- |
- for (k=0;k<job_total;k++) |
- if (job_list[k].ctx == context_list[i].ctx) { |
- task_type = PERIODICAL; |
- break; |
- } |
- |
- elaborate_statistics(i,task_type); |
- |
- } |
- |
- return 0; |
- |
-} |
- |
Index: rel_1_5_3/newtrace/utils/example_results |
=================================================================== |
--- rel_1_5_3/newtrace/utils/example_results (revision 1614) |
+++ rel_1_5_3/newtrace/utils/example_results (nonexistent) |
@@ -1,382 +0,0 @@ |
-This is an example file from "extract" utility, |
-some comments are added to make it clearer. |
- |
-Jumpball demo (ecp) statistics |
- |
-Clk/msec = 2202900 (CPU Athlon 64 3200+) |
- |
-EVT:Log starts at [147140694139] |
-EVT:Log ends at [196093930505] |
- |
-Total dTSC [ 48953236366] ns [ 22222113928] |
-Events [ 144915] |
-Execs [ 131127] |
-EndCycles [ 13759] |
- |
-Preemption Removing.... |
- |
-Total nsec of jobs [ 3604781671] |
-Total nsec of exec [ 22222113928] |
-Total nsec considering last clk/msec [ 22222178204] |
- |
-Compute Task Statistics.... |
- |
-Interrupts |
- Total Execution [ 29399348 ns] |
- Mean CPU Bandwidth [ 0.132298% ] |
- after first int [ 0.132298% ] |
- Interrupts Number [ 45842 ] |
- Min Interrupt [ 189 ns] |
- Mean Interrupt [ 641 ns] |
- Max Interrupt [ 13056 ns] |
- |
- Min Arr. Delta [ 1881 ns] |
- Mean Arr. Delta [ 484763 ns] |
- Max Arr. Delta [ 10000131 ns] |
- |
-- System Interrupts: All the hardware interrupts |
- |
-Periodical Task CTX [ 256] PID [ 9] |
- Total Execution [ 276253550 ns] |
- Mean CPU Bandwidth [ 1.243147% ] |
- after first exec [ 1.630252% ] |
- Execs Number [ 9335 ] |
- Min Exec [ 240 ns] |
- Mean Exec [ 29593 ns] |
- Max Exec [ 91661 ns] |
- |
- Total Job Exec [ 276253550 ns] |
- Jobs Number [ 1695 ] |
- Min Job [ 162239 ns] |
- Mean Job [ 162981 ns] |
- Max Job [ 164505 ns] |
- |
- Min Arr. Delta [ 4411818 ns] |
- Mean Arr. Delta [ 9999965 ns] |
- Max Arr. Delta [ 15588054 ns] |
- |
-- Task 9 "palla0": Soft Task. The CTX 256 was at the beginning assigned |
-to the "main" task. After the task death, the context was free until the |
-new "palla0" task was created. "main" task context number is converted to |
-1256 to make independent statistics. |
- |
-Background Task CTX [ 264] PID [ 1] |
- Total Execution [ 18583350900 ns] |
- Mean CPU Bandwidth [ 83.625487% ] |
- after first exec [ 83.669980% ] |
- Execs Number [ 16908 ] |
- Min Exec [ 515 ns] |
- Mean Exec [ 1099086 ns] |
- Max Exec [ 9836143 ns] |
- |
-- Task 1 "dummy": The dummy task, it represents the system |
-idle time, near 83% as mean value |
- |
-Background Task CTX [ 272] PID [ 2] |
- Total Execution [ 926 ns] |
- Mean CPU Bandwidth [ 0.000004% ] |
- after first exec [ 100.000000% ] |
- Execs Number [ 1 ] |
- Min Exec [ 926 ns] |
- Mean Exec [ 926 ns] |
- Max Exec [ 926 ns] |
- |
-- Task 2 "shutdown task": Shutting down the system. It closes |
-the tracer too (this is the reason of only 3 us exec time). |
- |
-Periodical Task CTX [ 280] PID [ 3] |
- Total Execution [ 1445626 ns] |
- Mean CPU Bandwidth [ 0.006505% ] |
- after first exec [ 0.006512% ] |
- Execs Number [ 461 ] |
- Min Exec [ 2583 ns] |
- Mean Exec [ 3135 ns] |
- Max Exec [ 4206 ns] |
- |
- Total Job Exec [ 1445626 ns] |
- Jobs Number [ 461 ] |
- Min Job [ 2583 ns] |
- Mean Job [ 3135 ns] |
- Max Job [ 4206 ns] |
- |
- Min Arr. Delta [ 2021387 ns] |
- Mean Arr. Delta [ 48260445 ns] |
- Max Arr. Delta [ 50010461 ns] |
- |
-- Task 3 "interrupt server": The interrupt context |
- |
-Periodical Task CTX [ 288] PID [ 4] |
- Total Execution [ 59506 ns] |
- Mean CPU Bandwidth [ 0.000268% ] |
- after first exec [ 0.000351% ] |
- Execs Number [ 43 ] |
- Min Exec [ 566 ns] |
- Mean Exec [ 1383 ns] |
- Max Exec [ 5850 ns] |
- |
- Total Job Exec [ 59506 ns] |
- Jobs Number [ 17 ] |
- Min Job [ 1217 ns] |
- Mean Job [ 3500 ns] |
- Max Job [ 9358 ns] |
- |
- Min Arr. Delta [ 65650086 ns] |
- Mean Arr. Delta [ 1059090305 ns] |
- Max Arr. Delta [ 7168628909 ns] |
- |
-- Task 4 "key task": The task for keyboard handler |
- |
-Periodical Task CTX [ 296] PID [ 5] |
- Total Execution [ 1201275196 ns] |
- Mean CPU Bandwidth [ 5.405765% ] |
- after first exec [ 5.406917% ] |
- Execs Number [ 825 ] |
- Min Exec [ 11133 ns] |
- Mean Exec [ 1456091 ns] |
- Max Exec [ 4500554 ns] |
- |
- Total Job Exec [ 1201275196 ns] |
- Jobs Number [ 223 ] |
- Min Job [ 5296076 ns] |
- Mean Job [ 5386884 ns] |
- Max Job [ 5515636 ns] |
- |
- Min Arr. Delta [ 99757430 ns] |
- Mean Arr. Delta [ 100006689 ns] |
- Max Arr. Delta [ 101061945 ns] |
- |
-- Task 5 "jetctrl" : Soft task |
- |
-Periodical Task CTX [ 304] PID [ 6] |
- Total Execution [ 4254996 ns] |
- Mean CPU Bandwidth [ 0.019148% ] |
- after first exec [ 0.019156% ] |
- Execs Number [ 446 ] |
- Min Exec [ 1111 ns] |
- Mean Exec [ 9540 ns] |
- Max Exec [ 18912 ns] |
- |
- Total Job Exec [ 4254996 ns] |
- Jobs Number [ 223 ] |
- Min Job [ 18971 ns] |
- Mean Job [ 19080 ns] |
- Max Job [ 21052 ns] |
- |
- Min Arr. Delta [ 95501610 ns] |
- Mean Arr. Delta [ 99979413 ns] |
- Max Arr. Delta [ 102456106 ns] |
- |
-- Task 6 "jetdummy" : Soft Task |
- |
-Periodical Task CTX [ 312] PID [ 7] |
- Total Execution [ 341582118 ns] |
- Mean CPU Bandwidth [ 1.537127% ] |
- after first exec [ 1.537767% ] |
- Execs Number [ 936 ] |
- Min Exec [ 520 ns] |
- Mean Exec [ 364938 ns] |
- Max Exec [ 1300811 ns] |
- |
- Total Job Exec [ 341582118 ns] |
- Jobs Number [ 223 ] |
- Min Job [ 1530776 ns] |
- Mean Job [ 1531758 ns] |
- Max Job [ 1533632 ns] |
- |
- Min Arr. Delta [ 95494710 ns] |
- Mean Arr. Delta [ 99979490 ns] |
- Max Arr. Delta [ 102948741 ns] |
- |
-- Task 7 "jetslice": Soft Task |
- |
-Periodical Task CTX [ 320] PID [ 8] |
- Total Execution [ 361875645 ns] |
- Mean CPU Bandwidth [ 1.628448% ] |
- after first exec [ 1.628782% ] |
- Execs Number [ 6750 ] |
- Min Exec [ 2540 ns] |
- Mean Exec [ 53611 ns] |
- Max Exec [ 92451 ns] |
- |
- Total Job Exec [ 361875645 ns] |
- Jobs Number [ 2222 ] |
- Min Job [ 162349 ns] |
- Mean Job [ 162860 ns] |
- Max Job [ 166904 ns] |
- |
- Min Arr. Delta [ 9989352 ns] |
- Mean Arr. Delta [ 9999971 ns] |
- Max Arr. Delta [ 10010719 ns] |
- |
-- Task 8 "pallaEDF": Hard Task |
- |
-Background Task CTX [ 1256] PID [ 0] |
- Total Execution [ 4573409 ns] |
- Mean CPU Bandwidth [ 0.020580% ] |
- after first exec [ 0.020580% ] |
- Execs Number [ 6 ] |
- Min Exec [ 7166 ns] |
- Mean Exec [ 762234 ns] |
- Max Exec [ 2000656 ns] |
- |
-- Task 0 "main": Main task was killed, so the original context |
-number 256 became 1256 |
- |
-Periodical Task CTX [ 328] PID [ 10] |
- Total Execution [ 270267226 ns] |
- Mean CPU Bandwidth [ 1.216208% ] |
- after first exec [ 1.629184% ] |
- Execs Number [ 8846 ] |
- Min Exec [ 241 ns] |
- Mean Exec [ 30552 ns] |
- Max Exec [ 91592 ns] |
- |
- Total Job Exec [ 270267226 ns] |
- Jobs Number [ 1659 ] |
- Min Job [ 162232 ns] |
- Mean Job [ 162909 ns] |
- Max Job [ 164270 ns] |
- |
- Min Arr. Delta [ 9988124 ns] |
- Mean Arr. Delta [ 9999982 ns] |
- Max Arr. Delta [ 10032718 ns] |
- |
-- Task 10 "palla1": Soft Task |
- |
-Periodical Task CTX [ 336] PID [ 11] |
- Total Execution [ 264105857 ns] |
- Mean CPU Bandwidth [ 1.188482% ] |
- after first exec [ 1.630505% ] |
- Execs Number [ 8949 ] |
- Min Exec [ 239 ns] |
- Mean Exec [ 29512 ns] |
- Max Exec [ 91573 ns] |
- |
- Total Job Exec [ 264105857 ns] |
- Jobs Number [ 1620 ] |
- Min Job [ 162271 ns] |
- Mean Job [ 163028 ns] |
- Max Job [ 164299 ns] |
- |
- Min Arr. Delta [ 9989381 ns] |
- Mean Arr. Delta [ 9999964 ns] |
- Max Arr. Delta [ 10010620 ns] |
- |
-- Task 11 "palla2": Soft Task |
- |
-Periodical Task CTX [ 344] PID [ 12] |
- Total Execution [ 257971822 ns] |
- Mean CPU Bandwidth [ 1.160879% ] |
- after first exec [ 1.634880% ] |
- Execs Number [ 10631 ] |
- Min Exec [ 238 ns] |
- Mean Exec [ 24265 ns] |
- Max Exec [ 63831 ns] |
- |
- Total Job Exec [ 257971822 ns] |
- Jobs Number [ 1578 ] |
- Min Job [ 162684 ns] |
- Mean Job [ 163480 ns] |
- Max Job [ 164782 ns] |
- |
- Min Arr. Delta [ 9989399 ns] |
- Mean Arr. Delta [ 9999963 ns] |
- Max Arr. Delta [ 10010599 ns] |
- |
-- Task 12 "palla3": Soft Task |
- |
-Periodical Task CTX [ 352] PID [ 13] |
- Total Execution [ 250406676 ns] |
- Mean CPU Bandwidth [ 1.126836% ] |
- after first exec [ 1.630586% ] |
- Execs Number [ 8461 ] |
- Min Exec [ 240 ns] |
- Mean Exec [ 29595 ns] |
- Max Exec [ 91753 ns] |
- |
- Total Job Exec [ 250406676 ns] |
- Jobs Number [ 1536 ] |
- Min Job [ 162225 ns] |
- Mean Job [ 163025 ns] |
- Max Job [ 164557 ns] |
- |
- Min Arr. Delta [ 3184436 ns] |
- Mean Arr. Delta [ 9999970 ns] |
- Max Arr. Delta [ 16815492 ns] |
- |
-- Task 13 "palla4": Soft Task |
- |
-Periodical Task CTX [ 360] PID [ 14] |
- Total Execution [ 132048658 ns] |
- Mean CPU Bandwidth [ 0.594222% ] |
- after first exec [ 1.631180% ] |
- Execs Number [ 4462 ] |
- Min Exec [ 244 ns] |
- Mean Exec [ 29594 ns] |
- Max Exec [ 91702 ns] |
- |
- Total Job Exec [ 132048658 ns] |
- Jobs Number [ 810 ] |
- Min Job [ 162240 ns] |
- Mean Job [ 163023 ns] |
- Max Job [ 164337 ns] |
- |
- Min Arr. Delta [ 4934088 ns] |
- Mean Arr. Delta [ 9999968 ns] |
- Max Arr. Delta [ 15066505 ns] |
- |
-- Task 14 "palla5": Soft Task |
- |
-Periodical Task CTX [ 368] PID [ 15] |
- Total Execution [ 125033245 ns] |
- Mean CPU Bandwidth [ 0.562652% ] |
- after first exec [ 1.632032% ] |
- Execs Number [ 4239 ] |
- Min Exec [ 242 ns] |
- Mean Exec [ 29495 ns] |
- Max Exec [ 91828 ns] |
- |
- Total Job Exec [ 125033245 ns] |
- Jobs Number [ 767 ] |
- Min Job [ 162266 ns] |
- Mean Job [ 163015 ns] |
- Max Job [ 164284 ns] |
- |
- Min Arr. Delta [ 9187114 ns] |
- Mean Arr. Delta [ 9999969 ns] |
- Max Arr. Delta [ 10802835 ns] |
- |
-- Task 15 "palla6": Soft Task |
- |
-Periodical Task CTX [ 376] PID [ 16] |
- Total Execution [ 118201550 ns] |
- Mean CPU Bandwidth [ 0.531910% ] |
- after first exec [ 1.631159% ] |
- Execs Number [ 3985 ] |
- Min Exec [ 244 ns] |
- Mean Exec [ 29661 ns] |
- Max Exec [ 91622 ns] |
- |
- Total Job Exec [ 118201550 ns] |
- Jobs Number [ 725 ] |
- Min Job [ 162270 ns] |
- Mean Job [ 163036 ns] |
- Max Job [ 164089 ns] |
- |
- Min Arr. Delta [ 7797571 ns] |
- Mean Arr. Delta [ 9999955 ns] |
- Max Arr. Delta [ 12192001 ns] |
- |
-- Task 16 "palla7": Soft Task |
- |
-Background Task CTX [ 248] PID [NODEF] |
- Total Execution [ 7674 ns] |
- Mean CPU Bandwidth [ 0.000035% ] |
- after first exec [ 72.711768% ] |
- Execs Number [ 1 ] |
- Min Exec [ 7674 ns] |
- Mean Exec [ 7674 ns] |
- Max Exec [ 7674 ns] |
- |
-- Global context: the kernel context |
- |
Index: rel_1_5_3/newtrace/utils/list.c |
=================================================================== |
--- rel_1_5_3/newtrace/utils/list.c (revision 1614) |
+++ rel_1_5_3/newtrace/utils/list.c (nonexistent) |
@@ -1,112 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * Tullio Facchinetti <tullio.facchinetti@unipv.it> |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- * http://robot.unipv.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <stdio.h> |
-#include <unistd.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#define READ_BUFFER 2000 |
-#define DELTA_BUFFER 100 |
- |
-int main(int argc, char *argv[]) |
-{ |
- |
- char buffer[READ_BUFFER+DELTA_BUFFER]; |
- void *p, *last; |
- int n,delta,size; |
- |
- unsigned long long tsc_value; |
- |
- unsigned long long ev = 0; |
- |
- FILE *input_file; |
- |
- if (argc < 2) { |
- printf("%s: Enter the input file name [%s filename]\n",argv[0],argv[0]); |
- exit(1); |
- } |
- |
- input_file = fopen(argv[1],"rb"); |
- |
- last = buffer + READ_BUFFER; |
- |
- while(!feof(input_file)) { |
- |
- //move remaining byte |
- delta = (unsigned int)(buffer) + READ_BUFFER - (unsigned int)(last); |
- if (delta > 0) memcpy(buffer,last,delta); |
- |
- n = fread(buffer+delta,1,READ_BUFFER+10,input_file); |
- fseek(input_file,-(delta+10),SEEK_CUR); |
- |
- p = buffer; |
- |
- while ((unsigned int)(p) + 16 <= (unsigned int)(buffer + READ_BUFFER) && |
- (unsigned int)(p) + 16 <= (unsigned int)(buffer + n + delta)) { |
- |
- printf("%08d Type = %02x ",(unsigned int)ev,*(unsigned short int *)(p)); |
- |
- tsc_value = (unsigned long long)(*(unsigned int *)(p+4)) << 32; |
- tsc_value += (unsigned long long)(*(unsigned int *)(p+8)); |
- |
- printf("TSC = %llu (%08x:%08x)",tsc_value, *(unsigned int *)(p+4),*(unsigned int *)(p+8)); |
- |
- size = 16; |
- |
- printf(" Par1 = %11d",*(unsigned short int *)(p+2)); |
- printf(" Par2 = %11d\n",*(unsigned int *)(p+12)); |
- |
- ev++; |
- |
- p += 16; |
- |
- if ((unsigned int)(p) + 10 > (unsigned int)(buffer + n + delta)) break; |
- |
- last = p; |
- |
- } |
- |
- if ((unsigned int)(p) + 10 > (unsigned int)(buffer + n + delta)) break; |
- |
- } |
- |
- fclose(input_file); |
- |
- return 0; |
- |
-} |
- |
Index: rel_1_5_3/newtrace/utils/pwcet_gen.c |
=================================================================== |
--- rel_1_5_3/newtrace/utils/pwcet_gen.c (revision 1614) |
+++ rel_1_5_3/newtrace/utils/pwcet_gen.c (nonexistent) |
@@ -1,275 +0,0 @@ |
-/* |
- * Project: S.Ha.R.K. |
- * |
- * Coordinators: |
- * Giorgio Buttazzo <giorgio@sssup.it> |
- * Paolo Gai <pj@gandalf.sssup.it> |
- * |
- * Authors : |
- * Giacomo Guidi <giacomo@gandalf.sssup.it> |
- * |
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
- * |
- * http://www.sssup.it |
- * http://retis.sssup.it |
- * http://shark.sssup.it |
- */ |
- |
-/* |
- * This program is free software; you can redistribute it and/or modify |
- * it under the terms of the GNU General Public License as published by |
- * the Free Software Foundation; either version 2 of the License, or |
- * (at your option) any later version. |
- * |
- * This program is distributed in the hope that it will be useful, |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- * GNU General Public License for more details. |
- * |
- * You should have received a copy of the GNU General Public License |
- * along with this program; if not, write to the Free Software |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * |
- */ |
- |
-#include <stdio.h> |
-#include <unistd.h> |
-#include <stdlib.h> |
-#include <string.h> |
- |
-#include <FTrace.h> |
- |
-#define READ_BUFFER 2000 |
-#define DELTA_BUFFER 100 |
- |
-int main(int argc, char *argv[]) |
-{ |
- |
- char buffer[READ_BUFFER+DELTA_BUFFER]; |
- void *p, *last; |
- int n,delta,size,tsc; |
- |
- unsigned long long ev = 0, tsc_value; |
- |
- FILE *input_file; |
- |
- if (argc < 2) { |
- printf("%s: Enter the input file name [%s filename]\n",argv[0],argv[0]); |
- exit(1); |
- } |
- |
- input_file = fopen(argv[1],"rb"); |
- |
- last = buffer + READ_BUFFER; |
- |
- while(!feof(input_file)) { |
- |
- //move remaining byte |
- delta = (unsigned int)(buffer) + READ_BUFFER - (unsigned int)(last); |
- if (delta > 0) memcpy(buffer,last,delta); |
- |
- n = fread(buffer+delta,1,READ_BUFFER+10,input_file); |
- fseek(input_file,-(delta+10),SEEK_CUR); |
- |
- p = buffer; |
- /* |
- // specific server events |
- #define FTrace_EVT_server_create 0x08 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_replenish 0x18 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_exhaust 0x28 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_reclaiming 0x38 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_remove 0x48 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_active 0x58 // Par1 [empty] Par2 [server] |
- #define FTrace_EVT_server_using_rec 0x68 // Par1 [reclaiming] Par2 [server] |
- */ |
- |
- while ((unsigned int)(p) + 16 <= (unsigned int)(buffer + READ_BUFFER) && |
- (unsigned int)(p) + 16 <= (unsigned int)(buffer + n + delta)) { |
- |
- tsc = 0; |
- |
- switch (*(unsigned short int *)(p) & 0x00FF) { |
- |
- case FTrace_EVT_ipoint: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- tsc = 1; |
- break; |
- |
- /* Tracer start */ |
- case FTrace_EVT_trace_start: |
- printf("0 "); |
- tsc = 1; |
- break; |
- |
- /* Tracer stop */ |
- case FTrace_EVT_trace_stop: |
- printf("1 "); |
- tsc = 1; |
- break; |
- |
- /* Interrupt start (int num) */ |
- case FTrace_EVT_timer_wakeup_start: |
- case FTrace_EVT_interrupt_start: |
- printf("2 "); |
- tsc = 1; |
- break; |
- |
- /* Interrupt Stop (int num, or context num is int 3) */ |
- case FTrace_EVT_timer_wakeup_end: |
- case FTrace_EVT_interrupt_end: |
- printf("3 "); |
- tsc = 1; |
- break; |
- |
- /* Context to (context num) */ |
- case FTrace_EVT_context_switch: |
- printf("4 "); |
- tsc = 1; |
- break; |
- |
- /* Task Create (context num, pid num) */ |
- case FTrace_EVT_task_create: |
- printf("5 "); |
- tsc = 1; |
- break; |
- |
- /* Task Activate (context num) */ |
- case FTrace_EVT_task_activate: |
- printf("6 "); |
- tsc = 1; |
- break; |
- |
- /* Task End (context num) */ |
- case FTrace_EVT_task_end: |
- printf("7 "); |
- tsc = 1; |
- break; |
- |
- /* Task End-Cycle (context num) */ |
- case FTrace_EVT_task_end_cycle: |
- printf("8 "); |
- tsc = 1; |
- break; |
- |
- /* Task Context - PID declaration */ |
- case FTrace_EVT_id: |
- printf("9 "); |
- tsc = 1; |
- break; |
- |
- case FTrace_EVT_cycles_per_msec: |
- printf("10 "); |
- tsc = 1; |
- break; |
- // specific server events |
- |
- case FTrace_EVT_server_active: |
- printf("16 "); |
- tsc=1; |
- break; |
- |
- case FTrace_EVT_task_deadline_miss: |
- printf("20 "); |
- tsc = 1; |
- break; |
- |
- case FTrace_EVT_task_wcet_violation: |
- printf("21 "); |
- tsc = 1; |
- break; |
- |
- } |
- |
- tsc_value = (unsigned long long)(*(unsigned int *)(p+4)) << 32; |
- tsc_value += (unsigned long long)(*(unsigned int *)(p+8)); |
- |
- if (tsc == 1) { |
- |
- printf("%llu ",tsc_value); |
- |
- switch (*(unsigned short int *)(p) & 0x00FF) { |
- |
- case FTrace_EVT_trace_start: |
- printf("%d %d ",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_interrupt_start: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_timer_wakeup_start: |
- printf("%d ",0); |
- break; |
- |
- case FTrace_EVT_timer_wakeup_end: |
- case FTrace_EVT_interrupt_end: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_context_switch: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_task_create: |
- printf("%d %d",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_task_deadline_miss: |
- printf("%d %d",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_task_wcet_violation: |
- printf("%d %d",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_task_activate: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_task_end_cycle: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_task_end: |
- printf("%d ",*(unsigned short int *)(p+2)); |
- break; |
- |
- case FTrace_EVT_id: |
- printf("%d %d",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_cycles_per_msec: |
- printf("%d ",*(unsigned int *)(p+12)); |
- break; |
- |
- case FTrace_EVT_server_active: |
- printf("%d %d",*(unsigned short int *)(p+2),*(unsigned int *)(p+12)); |
- break; |
- } |
- |
- printf("\n"); |
- |
- } |
- |
- size = 16; |
- |
- ev++; |
- |
- p += 16; |
- |
- if ((unsigned int)(p) + 10 > (unsigned int)(buffer + n + delta)) break; |
- |
- last = p; |
- |
- } |
- |
- if ((unsigned int)(p) + 10 > (unsigned int)(buffer + n + delta)) break; |
- |
- } |
- |
- fclose(input_file); |
- |
- return 0; |
- |
-} |
- |
Index: rel_1_5_3/newtrace/utils/README |
=================================================================== |
--- rel_1_5_3/newtrace/utils/README (revision 1614) |
+++ rel_1_5_3/newtrace/utils/README (nonexistent) |
@@ -1,19 +0,0 @@ |
-Utility usage: |
- |
-1) udpdump: ./udpdump dumptest |
- |
- - It receives all the UDP tracer packets, |
- saving them inside the "dumptest" file |
- |
-2) pwcet_gen: ./pwcet_gen dumptest > dumptest.pwc |
- |
- - It converts the binary file to a text |
- version with only significative tracer events |
- |
-3) extract: ./extract dumptest.pwc |
- |
- - It shows all the recorded tasks main |
- statistics, usign also "gnuplot" to display |
- execution time distributions, inter-arrival times, |
- and task demand functions. |
- |
Index: rel_1_5_3/newtrace/utils/makefile |
=================================================================== |
--- rel_1_5_3/newtrace/utils/makefile (revision 1614) |
+++ rel_1_5_3/newtrace/utils/makefile (nonexistent) |
@@ -1,36 +0,0 @@ |
-# |
-# util_linux -> compiles the tracer utilities under Linux |
-# |
- |
-ifndef BASE |
-BASE=../../.. |
-endif |
- |
-.PHONY: util_dos util_linux clean |
- |
-all: |
- @echo Targets: util_dos util_linux clean |
- @echo Note: udpdump and list are available only under linux |
- |
-util_linux: udpdump list pwcet_gen extract |
- |
-udpdump: udpdump.c |
- gcc -Wimplicit-function-declaration -Wall -ggdb\ |
- -I$(BASE)/tracer/include -I$(BASE)/oslib udpdump.c -o udpdump |
- |
-list: list.c |
- gcc -Wimplicit-function-declaration -Wall -ggdb\ |
- -I$(BASE)/tracer/include -I$(BASE)/oslib list.c -o list |
- |
-pwcet_gen: pwcet_gen.c |
- gcc -Wimplicit-function-declaration -Wall -ggdb\ |
- -I$(BASE)/tracer/include -I$(BASE)/oslib pwcet_gen.c -o pwcet_gen |
- |
-extract: extract.c |
- gcc -Wimplicit-function-declaration -Wall -ggdb -lm\ |
- -I$(BASE)/tracer/include -I$(BASE)/oslib extract.c -o extract |
- |
-clean: |
- rm -rf *.o udpdump list pwcet_gen extract |
- |
- |
Index: rel_1_5_3/newtrace/utils/test |
=================================================================== |
--- rel_1_5_3/newtrace/utils/test (revision 1614) |
+++ rel_1_5_3/newtrace/utils/test (nonexistent) |
@@ -1,919 +0,0 @@ |
- ®'¿¨{ ` Á(¿¨ ` *¿¨ ` ?+¿¨ ` ,¿¨ ` À-¿¨ ( Á¨ ( !Á¨ ,Á¨ W8Á¨ ( $:Á¨ BÁ¨ ( OÁ¨( SÁ¨ ( ÂXÁ¨ Á¨ ËïÁ¨ b ( õÁ¨ ,ùÁ¨ 0ûÁ¨ Ä Â¨ B HV¨ =d¨ Ih¨ 'j¨ + 4tø¨ iø¨ ø¨ Íø¨ ; Yø¨ ¶ø¨ b ؽø¨ PÁø¨ lÂø¨ + -ù¨ Û1ù¨ B4ù¨ ( n5ù¨ ( "8ù¨( ï:ù¨ ; ( |
->ù¨ èù¨ >ù¨ b ( àù¨ ¯ù¨ Çù¨ + 0© ; ¦0© + =1© Ô?1© B1© ( >C1© ( ÈE1©( uG1© ; ( {I1© ¶1© Ù 1© b ( £1© ä1© Ð¥1© + Oi© ÂQi© Ti© ( (Ui© ( Wi©( Yi© ; ( ÿZi© §¯i© ¥±i© b ( ɳi© µi© ¶i© + %c¡© Xe¡© g¡© ( °h¡© ( k¡©( l¡© ; ( n¡© á© öÄ¡© b ( Ç¡© ÌÈ¡© ÙÉ¡© + uÙ© MwÙ© yÙ© ( ¸zÙ© ( }Ù©( ~Ù© ; ( Ù© DÕÙ© 5×Ù© b ( ½ØÙ© rÚÙ© ÛÙ© + Ϫ Òª Ôª ïÖª ; Úª ¡ãª b .çª Ñèª àéª + ˪ ,ª oª ( £ª ( ª( Áª ; ( ôª §éª ìëª b ( síª 2ïª Aðª + èHª ; ¥êHª + >Iª Iª ÖIª ( ú Iª ( £Iª( 7¥Iª ; ( 1§Iª üIª þIª b ( F Jª Jª
-Jª + 3®ª p°ª IJª ( 볪 ( K¶ª( Í·ª ; ( ¾¹ª 3ª %ª b ( Iª |
-ª ª + 6À¹ª h¹ª Ĺª ( ¸Å¹ª ( ȹª( ɹª ; ( ˹ª & ºª "ºª b ( ;$ºª ò%ºª ÿ&ºª + Óñª ÑÕñª 'Øñª ( CÙñª ( Ûñª( Ýñª ; (
-ßñª 3òª 5òª b ( 7òª Æ8òª Õ9òª + ü+)« ¹.)« å0)« ³3)« ; Ñ6)« Q@)« b C)« ?E)« NF)« + úå)« [è)« Cë)« ( Wì)« ( °î)«( ^ð)« ; ( ò)« JH*« °J*« b ( 8L*« ýM*« O*« + êCa« ; Fa« + øa« Øúa« ýa« ( :þa« ( b«( (b« ; ( ,b« ÍXb« ÌZb« b ( ü\b« ±^b« Í_b« + R« « ׫ ( è« ( H«( É« ; ( º« <l« -n« b ( Qp« r« s« + ?Ò« m Ò« ¡"Ò« ( ¹#Ò« ( &Ò«( 'Ò« ; ( )Ò« ÷}Ò« éÒ« b (
-Ò« ÃÒ« ÐÒ« + e1 |
-¬ ¦3 |
-¬ í5 |
-¬ ( ø6 |
-¬ ( K9 |
-¬( Ì: |
-¬ ; ( Î< |
-¬ t |
-¬ h |
-¬ b ( ð |
-¬ § |
-¬ ¶ |
-¬ + IA¬ |
-A¬ A¬ ×A¬ ; øA¬ aA¬ b ©¢A¬ X¤A¬ g¥A¬ + °CB¬
-FB¬ lHB¬ ( IB¬ ( õKB¬( ¤MB¬ ; ( ÃOB¬ +¥B¬ n§B¬ b ( ç¨B¬ ¦ªB¬ µ«B¬ + £y¬ ; ,¦y¬ + ÆVz¬ Yz¬ C[z¬ ( Z\z¬ ( ¸^z¬( U`z¬ ; ( Zbz¬ .·z¬ S¹z¬ b ( y»z¬ 3½z¬ O¾z¬ + hi²¬ °k²¬ n²¬ ( 8o²¬ ( ×q²¬( is²¬ ; ( Zu²¬ ¥É²¬ Ó˲¬ b ( β¬ µÏ²¬ Äв¬ + `}ê¬ ê¬ ×ê¬ ( ûê¬ ( ~
ê¬( ê¬ ; ( õê¬ QÝê¬ Gßê¬ b ( káê¬ "ãê¬ /äê¬ + X" " à" ( ü" ( O"( Ñ" ; ( Æ" ï" ñ" b ( ºò" lô" {õ" + ôèY ±ëY ÉíY ðY ; ³óY #ýY b i Z Z Z + Ü¢Z >¥Z §Z ( ¨¨Z ( «Z( ¬Z ; ( ήZ [ {[ b ( þ[ à [ Ò |
-[ + $ ; Ç + ѵ ¸ Pº ( g» ( º½( U¿ ; ( [Á á Ý b ( Ç ã + ïÇÊ 0ÊÊ tÌÊ (
ÍÊ ( åÏÊ( fÑÊ ; ( YÓÊ §'Ë )Ë b ( Þ+Ë -Ë .Ë + Û® IÝ® }ß® ( à® ( öâ®( wä® ; ( hæ® :® <® b ( Ó>® @® A® + î:® Qð:® ò:® ( £ó:® ( öõ:®( w÷:® ; ( yù:® ÔM;® ÅO;® b ( lQ;® S;® .T;® + 7Fr® ÿHr® Kr® ÖMr® ; õPr® ¿[r® b _r® ¨`r® ·ar® + s® {s® Ás® ( ës® ( Js®( ë s® ; ( s® Aas®
cs® b ( es® Çfs® Ögs® + /^ª® ; Ò`ª® + Ü«® !«® d«® ( «® ( Ü«®( w«® ; ( q«® )s«® -u«® b ( bw«® y«® )z«® + &ã® ê(ã® 3+ã® ( Z,ã® ( º.ã®( <0ã® ; ( -2ã® ã® ã® b ( Ìã® yã® ã® + 8¯ Ì:¯ =¯ ( >¯ ( {@¯( þA¯ ; ( óC¯ n¯ _¯ b ( ¢¯ Y¯ f¯ + ÜKS¯ NS¯ dPS¯ ( QS¯ ( ÓSS¯( UUS¯ ; ( FWS¯ ЫS¯ ÄS¯ b ( k¯S¯ ±S¯ ,²S¯ + 4¤¯ õ¦¯
-©¯ ᫯ ; ý®¯ ¹¯ b ȼ¯ k¾¯ z¿¯ + '^¯ `¯ Øb¯ ( ìc¯ ( Ef¯( ág¯ ; ( j¯ ¿¯ çÁ¯ b ( yï >ů MƯ + ¼Â¯ ; 3¿Â¯ + =qï ~sï ¼uï ( Óvï ( &yï( Ázï ; ( Ç|ï hÑï gÓï b ( Õï Q×ï mØï + |û¯ ½
û¯ û¯ ( û¯ ( rû¯( óû¯ ; ( æû¯ [ãû¯ Låû¯ b ( çû¯ Féû¯ Uêû¯ + É3° ÷3° +3° ( C3° ( ¤3°( % 3° ; ( ¢3° ö3° tø3° b ( ·ú3° sü3° ý3° + ð©k° 1¬k° x®k° ( ¯k° ( Ö±k°( W³k° ; ( Yµk° å l° Öl° b ( }
-l° 0l° ?l° + H£° £° £° Ò £° ; ñ£° Z£° b £° C£° R£° + ¼£° m¾£° ³À£° ( ÝÁ£° ( <Ä£°( ÝÅ£° ; ( êÇ£° ᤰ % ¤° b ( ¨!¤° g#¤° v$¤° + ÏÛ° ; rÛ° + |ÏÛ° ÁÑÛ° ÔÛ° ( )ÕÛ° ( |×Û°( ÙÛ° ; ( ÛÛ° å/Ü° æ1Ü° b ( 4Ü° Õ5Ü° â6Ü° + øá± 5ä± ~æ± ( ¥ç± ( ê±( ë± ; ( xí± èA± ÚC± b ( F± ÏG± ÞH± + VõK± ÷K± ÆùK± ( ÞúK± ( =ýK±( ¿þK± ; ( ´ L± EUL± 6WL± b ( yYL± 0[L± =\L± + H±
± б ( ì± ( ?±( Á± ; ( ²± <g± 0i± b ( ×j± l± m± + a»± Îc»± æe»± ¼h»± ; Úk»± Ku»± b x»± 4z»± C{»± + ¼± d¼± ´¼± ( È ¼± ( !#¼±( ½$¼± ; ( ê&¼± M|¼± ³~¼± b ( E¼± |
-¼± ¼± + \yó± ; ÿ{ó± + .ô± J0ô± 2ô± ( 3ô± ( ò5ô±( 7ô± ; ( 9ô± 4ô± 3ô± b ( hô± ô± 9ô± + H@,² B,² ÍD,² ( ÞE,² ( >H,²( ¿I,² ; ( ²K,² 2 ,² #¢,² b ( f¤,² ¦,² ,§,² + 5Rd² cTd² Vd² ( ¯Wd² ( Zd²( [d² ; ( ]d² î±d² à³d² b ( #¶d² Ù·d² æ¸d² + \e² g² äi² ( ïj² ( Bm²( Ãn² ; ( Åp² QŲ BDz b ( éȲ ʲ «Ë² + $¿Ó² áÁÓ² íÃÓ² ®ÆÓ² ; ÍÉÓ² 1ÓÓ² b wÖÓ² ØÓ² )ÙÓ² + öxÔ² S{Ô² }Ô² ( Ã~Ô² ( "Ô²( ÃÔ² ; ( éÔ² rÚÔ² ºÜÔ² b ( =ÞÔ² üßÔ² áÔ² + m׳ ; Ú³ + ¬³ ñ³ 4³ ( Y³ ( ¬³( G³ ; ( A³ $ë³ (í³ b ( ]ï³ ñ³ $ò³ + £D³ à D³ )£D³ ( P¤D³ ( °¦D³( 2¨D³ ; ( #ªD³ þD³ E³ b ( ÂE³ oE³ ~E³ + °|³ ²|³ ú´|³ ( ¶|³ ( q¸|³( ó¹|³ ; ( ä»|³ _}³ P}³ b ( }³ J}³ W}³ + Íô³ |
-Æ´³ UÈ´³ ( qÉ´³ ( ÄË´³( FÍ´³ ; ( ;Ï´³ Æ#µ³ º%µ³ b ( a'µ³ )µ³ "*µ³ + ì³ \ ì³ "ì³ V%ì³ ; t(ì³ ß1ì³ b %5ì³ È6ì³ ×7ì³ + -Öì³ Øì³ áÚì³ ( õÛì³ ( NÞì³( êßì³ ; ( âì³ 7í³ þ9í³ b ( ;í³ U=í³ d>í³ + 6$´ ; º8$´ + Té$´ ë$´ Óí$´ ( êî$´ ( =ñ$´( Øò$´ ; ( äô$´
I%´ K%´ b ( ¶M%´ kO%´ P%´ + û\´ Ôý\´ ]´ ( )]´ ( ]´( |
-]´ ; ( ý]´ }[]´ n]]´ b ( ±_]´ ha]´ wb]´ + ë´ ´ M´ ( e´ ( Ä´( E´ ; ( 8´ ¤n´ p´ b ( Ùr´ t´ u´ + "Í´ S$Í´ &Í´ ( ¥'Í´ ( ø)Í´( y+Í´ ; ( {-Í´ Í´ øÍ´ b (
Í´ RÍ´ aÍ´ + jzµ '}µ 3µ ôµ ;
µ |µ b µ eµ tµ + ;4µ 6µ Õ8µ ( ÿ9µ ( ^<µ( ÿ=µ ; ( @µ µ õ b ( Fµ µ µ + m<µ ; <µ + G=µ eI=µ ¨K=µ ( ÍL=µ ( O=µ( »P=µ ; ( µR=µ §=µ ©=µ b ( ¿«=µ y=µ ®=µ + Yuµ Ù[uµ "^uµ ( I_uµ ( ©auµ( +cuµ ; ( euµ ¹uµ »uµ b ( ƽuµ x¿uµ Àuµ + ÿlµ 1oµ iqµ ( rµ ( àtµ( bvµ ; ( Wxµ é̵ Úε b ( ѵ ÔÒµ áÓµ + Wåµ åµ ßåµ ( û
åµ ( Nåµ( Ðåµ ; ( Ååµ Pàåµ Dâåµ b ( ëãåµ ååµ ¬æåµ + ´Ø¶ qÛ¶ ݶ `ච; ~㶠èì¶ b .ð¶ Ññ¶ àò¶ + §¶ ¶ X¶ ( l¶ ( Ŷ( a¶ ; ( ¶ åó¶ Jö¶ b ( Ü÷¶ ¡ù¶ °ú¶ + ôðT¶ ; óT¶ + ¡¥U¶ â§U¶ ªU¶ ( 7«U¶ ( U¶( %¯U¶ ; ( +±U¶ ÍV¶ ÉV¶ b ( þ V¶ ³V¶ ÏV¶ + Û·¶ º¶ `¼¶ ( q½¶ ( Ñ¿¶( RÁ¶ ; ( Eö Ŷ ¶¶ b ( ù¶ °¶ ¿¶ + 3ËŶ aÍŶ ÏŶ ( ÐŶ ( ÓŶ( ÔŶ ; ( ÖŶ ì*ƶ Þ,ƶ b ( !/ƶ ×0ƶ ä1ƶ + ZÞý¶ àý¶ ââý¶ ( íãý¶ ( @æý¶( Áçý¶ ; ( Ãéý¶ O>þ¶ @@þ¶ b ( çAþ¶ Cþ¶ ©Dþ¶ + ²65· o95· ;5· P>5· ; qA5· ÅJ5· b N5· ¨O5· ·P5· + ð5· öò5· <õ5· ( fö5· ( Åø5·( fú5· ; ( ü5· R6· GT6· b ( ÊU6· W6· X6· + òNm· ; Qm· + n· än· 'n· ( L n· ( n·( :
-n· ; ( 4n· dn· fn· b ( Phn· |
-jn· kn· + +¦· h¦· ±¦· ( ئ· ( 8¦·( º¦· ; ( «!¦· v¦· x¦· b ( Jz¦· ÷{¦· }¦· + )Þ· µ+Þ· í-Þ· ( /Þ· ( d1Þ·( æ2Þ· ; ( ×4Þ· WÞ· HÞ· b ( Þ· BÞ· OÞ· + Z;¸ =¸ â?¸ ( þ@¸ ( QC¸( ÓD¸ ; ( ÄF¸ N¸ B¸ b ( é¸ ¸ ª¡¸ + #M¸ æM¸ þM¸ ÌM¸ ; ìM¸ #ªM¸ b iM¸ ¯M¸ °M¸ + ON¸ vQN¸ ÍSN¸ ( áTN¸ ( :WN¸( ÖXN¸ ; ( [N¸ °N¸ õ²N¸ b ( ´N¸ L¶N¸ [·N¸ +
¸ ; B°
¸ + Ü`¸ c¸ [e¸ ( rf¸ ( Åh¸( `j¸ ; ( fl¸ Á¸ ø b ( ;Ÿ ðƸ ȸ + t¾¸ Çv¾¸ y¾¸ ( z¾¸ ( ||¾¸( ý}¾¸ ; ( 𾸠`Ô¾¸ QÖ¾¸ b ( ؾ¸ KÚ¾¸ ZÛ¾¸ + cö¸ ö¸ Åö¸ ( Ýö¸ ( >ö¸( ¿ö¸ ; ( °ö¸ æö¸
-èö¸ b ( Pêö¸ ìö¸ íö¸ + .¹ Ê.¹ .¹ ( .¹ ( o¡.¹( ð¢.¹ ; ( ò¤.¹ ~ù.¹ oû.¹ b ( ý.¹ Íþ.¹ Üÿ.¹ + Róe¹ öe¹ øe¹ Üúe¹ ; ûýe¹ df¹ b ª |
-f¹ Mf¹ \
-f¹ + #f¹ w¯f¹ ½±f¹ ( ç²f¹ ( Fµf¹( ç¶f¹ ; ( ð¸f¹ gg¹ «g¹ b ( .g¹ íg¹ üg¹ + U¹ ; ø
-¹ + À¹ G¹ Ĺ ( ¯Å¹ ( ȹ( ɹ ; ( ˹ k ¹ l"¹ b ( ¡$¹ [&¹ h'¹ + ~ÒÖ¹ »ÔÖ¹ ×Ö¹ ( +ØÖ¹ ( ÚÖ¹(
-ÜÖ¹ ; ( þÝÖ¹ n2×¹ `4×¹ b ( £6×¹ U8×¹ d9×¹ + qäº £æº Ûèº ( óéº ( Rìº( Ôíº ; ( Éïº [Dº LFº b ( Hº FJº SKº + É÷Fº úFº QüFº ( mýFº ( ÀÿFº( BGº ; ( 7Gº ÂWGº ¶YGº b ( ][Gº ]Gº ^Gº + Q~º TT~º lV~º 9Y~º ; U\~º ¿e~º b i~º ¨j~º ·k~º + |
-º oº ƺ ( Úº ( 3º( Ϻ ; ( º Wkº ¼mº b ( Noº qº "rº + ×i¶º ; zl¶º + ·º T·º !·º ( ©"·º ( ü$·º( &·º ; ( (·º ?}·º ;·º b ( p·º %·º A·º + ¸0ïº ù2ïº =5ïº ( N6ïº ( ®8ïº( /:ïº ; ( "<ïº ¢ïº ïº b ( Öïº ïº ïº + ¥B'» ÓD'» G'» ( H'» ( J'»( L'» ; ( òM'» ^¢'» P¤'» b ( ¦'» E¨'» R©'» + ÌU_»
-X_» TZ_» ( _[_» ( ²]_»( 3__» ; ( 5a_» Áµ_» ²·_» b ( Y¹_» »_» ¼_» + ¯» U²» u´» 6·» ; Yº» ¼Ã» b Ç» ¥È» ´É» + h» nj» ´l» ( Þm» ( =p»( Þq» ; ( t» É» ÊË» b ( MÍ» Ï» л + åÇλ ; Êλ + !{Ï» f}Ï» ©Ï» ( ÎÏ» ( !Ï»( ¼Ï» ; ( ¶Ï» ÛÏ» £ÝÏ» b ( ØßÏ» áÏ» âÏ» + ³¼ ð¼ 9¼ ( `¼ ( À¼( B¼ ; ( 3¼ í¼ ï¼ b ( Øñ¼
ó¼ ô¼ + ¡?¼ C£?¼ {¥?¼ ( ¦?¼ ( ò¨?¼( tª?¼ ; ( i¬?¼ å @¼ Ö@¼ b ( @¼ Ð@¼ Ý@¼ + S´w¼ ¶w¼ Û¸w¼ ( ÷¹w¼ ( J¼w¼( ̽w¼ ; ( Á¿w¼ Lx¼ @x¼ b ( çx¼ x¼ ¨x¼ + °¯¼ m¯¼
¯¼ R¯¼ ; n¯¼ ä ¯¼ b *$¯¼ Í%¯¼ Ü&¯¼ + Ư¼ ùȯ¼ P˯¼ ( d̯¼ ( ½Î¯¼( YЯ¼ ; ( Ò¯¼ (°¼ g*°¼ b ( ù+°¼ ¾-°¼ Í.°¼ + %ç¼ ; ´'ç¼ + ¾Ùç¼ ÿÛç¼ =Þç¼ ( Tßç¼ ( §áç¼( Bãç¼ ; ( Håç¼ ê9è¼ æ;è¼ b ( >è¼ Ð?è¼ ì@è¼ + øë½ 9î½ }ð½ ( ñ½ ( îó½( oõ½ ; ( b÷½ ÒK ½ ÃM ½ b ( P ½ ¾Q ½ ÍR ½ + @ÿW½ nX½ ¢X½ ( ºX½ ( X½( X½ ; ( |
-X½ ø^X½ ê`X½ b ( -cX½ ãdX½ ðeX½ + f½ §½ î½ ( ù½ ( L½( ͽ ; ( Ͻ [r½ St½ b ( úu½ ²w½ Áx½ + Äjǽ mǽ oǽ Xrǽ ; wuǽ á~ǽ b 'ǽ Êǽ Ùǽ + $Ƚ ô&Ƚ :)Ƚ ( d*Ƚ ( Ã,Ƚ( d.Ƚ ; ( m0Ƚ ä
Ƚ (Ƚ b ( «È½ jȽ yȽ + Òÿ½ ; u
ÿ½ + 7 ¾ Ä9 ¾ < |
---|