Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1609 → Rev 1610

/demos/trunk/loader/generators/lread.c
File deleted
/demos/trunk/loader/generators/lparser.c
File deleted
/demos/trunk/loader/generators/event_gen.c
File deleted
/demos/trunk/loader/generators/lread.h
File deleted
/demos/trunk/loader/generators/makefile
File deleted
/demos/trunk/loader/generators/lparser.h
File deleted
/demos/trunk/loader/generators/java/Application.java
File deleted
/demos/trunk/loader/generators/java/task_class.java
File deleted
/demos/trunk/loader/generators/java/fsf-schema.xsd
File deleted
/demos/trunk/loader/generators/java/timespec.java
File deleted
/demos/trunk/loader/generators/java/java_gen
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/loader/generators/java/makefile
===================================================================
--- trunk/loader/generators/java/makefile (revision 1609)
+++ trunk/loader/generators/java/makefile (nonexistent)
@@ -1,17 +0,0 @@
-ifdef CLASSPATH
-all:
- javac Application.java timespec.java task_class.java -classpath "$(CLASSPATH)/jdom.jar"
-else
-all:
- @echo ----------------------------------------------------------------
- @echo Please define the CLASSPATH environment variable!!!
- @echo ...something like: export CLASSPATH=/usr/java/j2sdk1.4.2/jre/lib
- @echo ----------------------------------------------------------------
- @exit 1
-endif
-
-
-clean:
- rm -f *.class
- rm -f event.c
-
Index: trunk/loader/loadfile/loadm.fsf
===================================================================
--- trunk/loader/loadfile/loadm.fsf (revision 1609)
+++ trunk/loader/loadfile/loadm.fsf (nonexistent)
@@ -1,72 +0,0 @@
-# CONTRACT SECTION
-#
-# CONTRACT NUMBER:CMIN:TMAX:CMAX:TMIN:WORKLOAD:DEADLINE:LOCAL SCHEDULER
-#
-# YOU WILL HAVE A SERVER FOR EACH SPECIFIED CONTRACT,
-# SO IN THE TASK SECTION YOU CAN SPECIFY THE "CONTRACT NUMBER"
-# INSTEAD OF THE SERVER NUMBER, WHICH IS CALCULATED INSIDE THE
-# LOADER
-#
-# ALL THE TIME PARAMETERS INSIDE THIS FILE ARE ALWAYS EXPRESSED AS
-# "[SECONDS][MICROSECONDS]" TO AVOID FLOATING POINT CALCULATIONS
-#
-# WORKLOAD
-# 0 BOUNDED
-# 1 INDETERMINATED
-#
-# LOCAL SCHEDULER
-# NONE - DEFAULT FOR THE FRAMEWORK
-# POSIX
-# EDF
-# RM
-#
-# TASK SECTION
-#
-# TASK TYPE:CONTRACT NUMBER:LOCAL SCHEDULER:NUMBER OF TASK:DEADLINE:WCET:TASK ACT TYPE (PAR1,PAR2,...):
-# :TASK EXEC TYPE (PAR1,PAR2,...):CRITICAL SESSION (PAR1,PAR2,PAR3,PAR4);
-#
-# TASK TYPE
-# OS - ONE_SHOT
-# CT - CYCLICAL_TASK
-# BT - BACKGROUND_TASK
-#
-# TASK EXEC TYPE
-# EXEC_CONST(TIME)
-# - CONSTANT EXEC TIME
-# EXEC_MEAN(MEAN, DELTA)
-# - VARIABLE EXEC TIME WITH CONSTANT DISTRIBUTION
-#
-# TASK ACTIVATION TIME
-# ACT_SINGLE(START_TIME)
-# ACT_PERIODIC(START_TIME, PERIOD)
-# ACT_MEAN(START_TIME, MEAN, DELTA)
-#
-# CRITICAL SESSION
-# CRIT(RES NUMBER, BLOCKING_TIME)
-# NO_CRIT
-#
-
-TOTAL_EXEC_TIME:[20][0];
-# SIMULATION TOTAL TIME
-
-CONTRACT SECTION
-
-[0]:[0][6000]:[0][30000]:[0][6000]:[0][30000]:[0]:[0][0]:EDF;
-[1]:[0][6000]:[0][60000]:[0][6000]:[0][60000]:[0]:[0][0]:EDF;
-[2]:[0][12000]:[0][60000]:[0][12000]:[0][60000]:[0]:[0][0]:POSIX;
-
-END
-
-TASK SECTION
-
-CT:[0]:EDF:[2]:[1][0]:[0][40000]:ACT_PERIODIC([1][0],[1][0]):
-:EXEC_CONST([0][16000]):CRIT([0],[0][2000]);
-
-CT:[1]:EDF:[2]:[1][0]:[0][40000]:ACT_PERIODIC([2][0],[1][0]):
-:EXEC_MEAN([0][16000],[0][10000]):CRIT([0],[0][2000]);
-
-BT:[2]:POSIX:[2]:[0][0]:[0][0]:ACT_SINGLE([3][0]):
-:EXEC_CONST([0][10000]):CRIT([0],[0][2000]);
-
-END
-
Index: trunk/loader/loadfile/load.fsf
===================================================================
--- trunk/loader/loadfile/load.fsf (revision 1609)
+++ trunk/loader/loadfile/load.fsf (nonexistent)
@@ -1,76 +0,0 @@
-# CONTRACT SECTION
-#
-# CONTRACT NUMBER:CMIN:TMAX:CMAX:TMIN:WORKLOAD:DEADLINE:LOCAL SCHEDULER
-#
-# YOU WILL HAVE A SERVER FOR EACH SPECIFIED CONTRACT,
-# SO IN THE TASK SECTION YOU CAN SPECIFY THE "CONTRACT NUMBER"
-# INSTEAD OF THE SERVER NUMBER, WHICH IS CALCULATED INSIDE THE
-# LOADER
-#
-# ALL THE TIME PARAMETERS INSIDE THIS FILE ARE ALWAYS EXPRESSED AS
-# "[SECONDS][MICROSECONDS]" TO AVOID FLOATING POINT CALCULATIONS
-#
-# WORKLOAD
-# 0 BOUNDED
-# 1 INDETERMINATED
-#
-# LOCAL SCHEDULER
-# POSIX
-# EDF
-# RM
-# NONE DEFAULT FROM THE FRAMEWORK
-#
-# TASK SECTION
-#
-# TASK TYPE:CONTRACT NUMBER:LOCAL SCHEDULER:NUMBER OF TASK:DEADLINE:WCET:TASK ACT TYPE (PAR1,PAR2,...):
-# :TASK EXEC TYPE (PAR1,PAR2,...):CRITICAL SESSION (PAR1,PAR2,PAR3,PAR4);
-#
-# TASK TYPE
-# OS - ONE_SHOT
-# CT - CYCLICAL_TASK
-# BT - BACKGROUND_TASK
-#
-# TASK EXEC TYPE
-# EXEC_CONST(TIME)
-# - CONSTANT EXEC TIME
-# EXEC_MEAN(MEAN, DELTA)
-# - VARIABLE EXEC TIME WITH CONSTANT DISTRIBUTION
-#
-# TASK ACTIVATION TIME
-# ACT_SINGLE(START_TIME)
-# ACT_PERIODIC(START_TIME, PERIOD)
-# ACT_MEAN(START_TIME, MEAN, DELTA)
-#
-# CRITICAL SESSION
-# CRIT(RES NUMBER, BLOCKING_TIME)
-# NO_CRIT
-#
-
-TOTAL_EXEC_TIME:[20][0];
-# SIMULATION TOTAL TIME
-
-CONTRACT SECTION
-
-[0]:[0][3000]:[0][10000]:[0][3000]:[0][10000]:[0]:[0][9000]:POSIX;
-[1]:[0][6000]:[0][30000]:[0][6000]:[0][30000]:[0]:[0][0]:POSIX;
-[2]:[0][3000]:[0][30000]:[0][3000]:[0][30000]:[0]:[0][0]:POSIX;
-[3]:[0][3000]:[0][20000]:[0][3000]:[0][20000]:[0]:[0][0]:POSIX;
-
-END
-
-TASK SECTION
-
-BT:[0]:POSIX:[1]:[0][0]:[0][0]:ACT_SINGLE([1][0]):
-:EXEC_CONST([0][25000]):NO_CRIT;
-
-BT:[1]:POSIX:[1]:[0][0]:[0][0]:ACT_SINGLE([2][0]):
-:EXEC_CONST([0][16000]):NO_CRIT;
-
-OS:[2]:POSIX:[1]:[0][0]:[0][0]:ACT_SINGLE([3][0]):
-:EXEC_CONST([1][0]):NO_CRIT;
-
-BT:[3]:POSIX:[5]:[0][0]:[0][0]:ACT_SINGLE([4][0]):
-:EXEC_CONST([0][10000]):NO_CRIT;
-
-END
-
Index: trunk/loader/loadfile/loadr.fsf
===================================================================
--- trunk/loader/loadfile/loadr.fsf (revision 1609)
+++ trunk/loader/loadfile/loadr.fsf (nonexistent)
@@ -1,72 +0,0 @@
-# CONTRACT SECTION
-#
-# CONTRACT NUMBER:CMIN:TMAX:CMAX:TMIN:WORKLOAD:DEADLINE:LOCAL SCHEDULER
-#
-# YOU WILL HAVE A SERVER FOR EACH SPECIFIED CONTRACT,
-# SO IN THE TASK SECTION YOU CAN SPECIFY THE "CONTRACT NUMBER"
-# INSTEAD OF THE SERVER NUMBER, WHICH IS CALCULATED INSIDE THE
-# LOADER
-#
-# ALL THE TIME PARAMETERS INSIDE THIS FILE ARE ALWAYS EXPRESSED AS
-# "[SECONDS][MICROSECONDS]" TO AVOID FLOATING POINT CALCULATIONS
-#
-# WORKLOAD
-# 0 BOUNDED
-# 1 INDETERMINATED
-#
-# LOCAL SCHEDULER
-# NONE - DEFAULT FOR THE FRAMEWORK
-# POSIX
-# EDF
-# RM
-#
-# TASK SECTION
-#
-# TASK TYPE:CONTRACT NUMBER:LOCAL SCHEDULER:NUMBER OF TASK:DEADLINE:WCET:TASK ACT TYPE (PAR1,PAR2,...):
-# :TASK EXEC TYPE (PAR1,PAR2,...):CRITICAL SESSION (PAR1,PAR2,PAR3,PAR4);
-#
-# TASK TYPE
-# OS - ONE_SHOT
-# CT - CYCLICAL_TASK
-# BT - BACKGROUND_TASK
-#
-# TASK EXEC TYPE
-# EXEC_CONST(TIME)
-# - CONSTANT EXEC TIME
-# EXEC_MEAN(MEAN, DELTA)
-# - VARIABLE EXEC TIME WITH CONSTANT DISTRIBUTION
-#
-# TASK ACTIVATION TIME
-# ACT_SINGLE(START_TIME)
-# ACT_PERIODIC(START_TIME, PERIOD)
-# ACT_MEAN(START_TIME, MEAN, DELTA)
-#
-# CRITICAL SESSION
-# CRIT(RES NUMBER, BLOCKING_TIME)
-# NO_CRIT
-#
-
-TOTAL_EXEC_TIME:[20][0];
-# SIMULATION TOTAL TIME
-
-CONTRACT SECTION
-
-[0]:[0][9000]:[0][30000]:[0][9000]:[0][30000]:[0]:[0][0]:EDF;
-[1]:[0][9000]:[0][30000]:[0][9000]:[0][30000]:[0]:[0][0]:EDF;
-[2]:[0][6000]:[0][60000]:[0][6000]:[0][60000]:[0]:[0][0]:POSIX;
-
-END
-
-TASK SECTION
-
-CT:[0]:EDF:[2]:[0][100000]:[0][40000]:ACT_PERIODIC([0][0],[0][100000]):
-:EXEC_MEAN([0][8000]:[0][14000]):NO_CRIT;
-
-CT:[1]:EDF:[2]:[0][100000]:[0][40000]:ACT_PERIODIC([0][0],[0][100000]):
-:EXEC_MEAN([0][8000]:[0][14000]):NO_CRIT;
-
-BT:[2]:POSIX:[2]:[0][0]:[0][0]:ACT_SINGLE([0][0]):
-:EXEC_CONST([0][10000]):NO_CRIT;
-
-END
-
Index: trunk/loader/loadfile/loadxml.fsf2
===================================================================
--- trunk/loader/loadfile/loadxml.fsf2 (revision 1609)
+++ trunk/loader/loadfile/loadxml.fsf2 (nonexistent)
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fsf_framework xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../generators/java/fsf-schema.xsd">
-
-<simulation>
-<time>20s 0u</time>
-</simulation>
-<contract>
- <cmin>0s 3000u</cmin>
- <tmax>0s 10000u</tmax>
- <cmax>0s 3000u</cmax>
- <tmin>0s 10000u</tmin>
- <workload>0</workload>
- <localscheduler type="POSIX">
- <task_section type="BackTask">
- <number>1</number>
- <act_section>
- <start_time>3s 0u</start_time>
- </act_section>
- <exec_section>
- <exec_time>3s 0u</exec_time>
- </exec_section>
- </task_section>
- <task_section type="OneShot">
- <number>2</number>
- <dline>0s 0u</dline>
- <wcet>0s 0u</wcet>
- <act_section>
- <start_time>3s 0u</start_time>
- </act_section>
- <exec_section>
- <exec_time>3s 0u</exec_time>
- </exec_section>
- </task_section>
- </localscheduler>
-</contract>
-<contract>
- <cmin>0s 3000u</cmin>
- <tmax>0s 10000u</tmax>
- <cmax>0s 3000u</cmax>
- <tmin>0s 10000u</tmin>
- <workload>0</workload>
- <localscheduler type="EDF">
- <task_section type="CyclicalTask">
- <number>1</number>
- <dline>1s 0u</dline>
- <wcet>0s 100000u</wcet>
- <act_section>
- <start_time>3s 0u</start_time>
- <period_time>1s 0u</period_time>
- </act_section>
- <exec_section>
- <exec_time>0s 10000u</exec_time>
- <delta_time>0s 10000u</delta_time>
- </exec_section>
- </task_section>
- </localscheduler>
-</contract>
-
-</fsf_framework>
Index: trunk/loader/marte/makefile.in
===================================================================
--- trunk/loader/marte/makefile.in (revision 1609)
+++ trunk/loader/marte/makefile.in (nonexistent)
@@ -1,7 +0,0 @@
-#
-# MaRTE OS dependecies
-#
-
-os_specific_dep:
- echo MaRTE dependencies here
-
Index: trunk/loader/shark/shark.h
===================================================================
--- trunk/loader/shark/shark.h (revision 1609)
+++ trunk/loader/shark/shark.h (nonexistent)
@@ -1,19 +0,0 @@
-#ifndef __SHARK_H__
-#define __SHARK_H__
-
-#include "nload.h"
-#include "lconst.h"
-
-#define MAX_MUTEX 20
-
-int calibrate_cycle();
-void start_simulation();
-void *get_task_model(struct loader_task *current);
-void set_simulation_time (struct timespec *total);
-void set_next_activation(struct timespec *next);
-void loader_task_activate(struct loader_task *l);
-int get_server_from_contract(int contract);
-
-void fsfinit();
-
-#endif
Index: trunk/loader/shark/shark.mak
===================================================================
--- trunk/loader/shark/shark.mak (revision 1609)
+++ trunk/loader/shark/shark.mak (nonexistent)
@@ -1,13 +0,0 @@
-ifndef BASE
-BASE=../../..
-endif
-
-include $(BASE)/config/config.mk
-
-PROGS = TEST
-
-include $(BASE)/config/example.mk
-
-TEST:
- make -f $(SUBMAKE) APP="nload" BASE=../../.. INIT= OTHEROBJS="event.o initfile.o shark.o fsfinit.o" OTHERINCL="-I." SHARKOPT="__LINUXC26__ __PCI__ __NET__ __FIRST__"
- cp nload TEST
Index: trunk/loader/shark/func.h
===================================================================
--- trunk/loader/shark/func.h (revision 1609)
+++ trunk/loader/shark/func.h (nonexistent)
@@ -1,112 +0,0 @@
-#ifndef __FUNC_H__
-#define __FUNC_H__
-
-#include "kernel/kern.h"
-#include "fsf_basic_types.h"
-#include "fsf_core.h"
-#include "fsf_server.h"
-#include "shark.h"
-
-#define OS_SHARK
-
-
-#define get_current_exec_task() exec_shadow
-/* Return the PID/pthread_t of calling task */
-
-#define generic_get_server_from_contract get_server_from_contract
-/* Return the server_id from the contract number used
- * inside .fsf file to define contract parameters
- *
- * generic_get_server_from_contract(int contract_number) */
-
-#define generic_calibrate_cycle calibrate_cycle
-/* Set the calibration parameter "cal_cycle"
- * only if it's initialized to 0. The calibration routine
- * calculates cal_cycle from CALIBRATION_DELTA.
- * This step can also be performed outside the demo.
- * Inside calibrate.h you can set the calibration parameters
- * for calibration step performed outside.
- *
- * cal_cycle is the number of cycles that are needed to
- * make CALIBRATION_DELTA number of iteration.
- *
- * kern_cli();
- * kern_gettime(&start);
- * for (i=0;i<CALIBRATION_DELTA;i++)
- * __asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
- * "cpuid\n\t"
- * :::"eax","ebx","ecx","edx");
- * kern_gettime(&end);
- * kern_sti();
- *
- * SUBTIMESPEC(&end,&start,&diff);
- * cal_cycles = TIMESPEC2USEC(&diff);
- *
- */
-
-#define generic_set_next_activation set_next_activation
-/* Set the next activation time. It's like fsf_schedule_next_timed_job
- * but it don't return nothing
- */
-
-#define generic_set_simulation_time set_simulation_time
-/* Set the end time of simulation */
-
-#define generic_get_task_model get_task_model
-/* Return a pointer to the struct that contains the
- * local shceduler parameter */
-
-#define generic_start_simulation start_simulation
-/* Start the simulation */
-
-#define generic_fsfinit() fsfinit()
-/* Create the fsf_server */
-
-#define generic_task_endcycle() task_endcycle()
-/* The job is finished */
-
-#define generic_end_simulation() exit(0)
-/* Exit from simulation */
-
-#define printf cprintf
-/* Printf standard function */
-
-/* Mutex */
-extern __inline__ void generic_lock_mutex(int res) {
- extern mutex_t mutex_table[MAX_MUTEX];
-
- mutex_lock(&mutex_table[res]);
-}
-
-extern __inline__ void generic_unlock_mutex(int res) {
- extern mutex_t mutex_table[MAX_MUTEX];
-
- mutex_unlock(&mutex_table[res]);
-}
-
-/* TASK RUNTIME FUNCTIONS */
-
-extern __inline__ void start_oneshot_task(void) {}
-extern __inline__ void end_oneshot_task(void) {}
-
-extern __inline__ void start_periodic_task(void) {}
-extern __inline__ void start_job_periodic_task(void) {
- task_testcancel();
-}
-extern __inline__ void end_job_periodic_task(void) {
- task_testcancel();
-}
-extern __inline__ void end_periodic_task(void) {}
-
-extern __inline__ void start_back_task(void) {}
-extern __inline__ void start_job_back_task(void) {
- task_testcancel();
-}
-extern __inline__ void end_job_back_task(void) {
- task_testcancel();
-}
-extern __inline__ void end_back_task(void) {}
-
-#endif
-
-
Index: trunk/loader/shark/makefile.in
===================================================================
--- trunk/loader/shark/makefile.in (revision 1609)
+++ trunk/loader/shark/makefile.in (nonexistent)
@@ -1,14 +0,0 @@
-#
-# Shark dependecies
-#
-
-os_specific_dep: out/shark.done out/makefile
-
-
-out/shark.done:
- cd out; cp -sf ../shark/*.c .
- cd out; cp -sf ../shark/*.h .
- touch out/shark.done
-
-out/makefile: shark/shark.mak
- sed -e "s/TEST/$(TEST)/" shark/shark.mak > out/makefile
Index: trunk/loader/shark/fsfinit.c
===================================================================
--- trunk/loader/shark/fsfinit.c (revision 1609)
+++ trunk/loader/shark/fsfinit.c (nonexistent)
@@ -1,62 +0,0 @@
-#include "kernel/kern.h"
-#include "fsf.h"
-#include "fsf_server.h"
-
-#include "func.h"
-
-extern struct loader_contract loader_contract_list[];
-extern int total_loader_contract;
-
-void fsfinit()
-{
-
- struct loader_contract *c;
- fsf_contract_parameters_t contract;
- fsf_server_id_t server;
- union sigval no_sigval = {0};
- int i;
- int err=0;
-
- FSF_start_service_task();
-
- for (i=0;i<total_loader_contract;i++) {
-
- c = &loader_contract_list[i];
-
- fsf_initialize_contract(&contract);
-
- err=fsf_set_contract_basic_parameters(&contract,&c->cmin,&c->tmax,c->workload);
- if (err) exit(err);
- err=fsf_set_contract_reclamation_parameters(&contract,&c->cmax,&c->tmin,FSF_DEFAULT_GRANULARITY, NULL, 1,1);
- if (err) exit(err);
-
- if (TIMESPEC2USEC(&c->deadline) != 0)
- err=fsf_set_contract_timing_requirements(&contract,false,&c->deadline,0,no_sigval,0,no_sigval);
- else
- err=fsf_set_contract_timing_requirements(&contract,true,NULL,0,no_sigval,0,no_sigval);
-
- if (err) exit(err);
-
- switch (c->local_scheduler) {
- case PAR_EDF:
- fsf_set_contract_scheduling_policy(&contract,FSF_EDF);
- break;
- case PAR_RM:
- fsf_set_contract_scheduling_policy(&contract,FSF_FP);
- break;
- case PAR_POSIX:
- fsf_set_contract_scheduling_policy(&contract,FSF_RR);
- break;
-
- }
-
-
- err=fsf_negotiate_contract(&contract,&server);
- if (err) exit(err);
- c->server = server;
-
- }
-
- print_server_list();
-
-}
Index: trunk/loader/shark/initfile.c
===================================================================
--- trunk/loader/shark/initfile.c (revision 1609)
+++ trunk/loader/shark/initfile.c (nonexistent)
@@ -1,182 +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 "posix/posix/posix.h"
-#include "grubstar.h"
-#include "fsf_basic_types.h"
-#include "fsf_core.h"
-
-#include "pi/pi/pi.h"
-#include "pc/pc/pc.h"
-
-#include "pthread.h"
-
-#include "sem/sem/sem.h"
-#include "hartport/hartport/hartport.h"
-#include "nop/nop/nop.h"
-
-#include <drivers/shark_linuxc26.h>
-#include <drivers/shark_pci26.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;
- int grubstar_level;
- int posix_level;
- int pi_level;
- int pc_level;
- LEVEL EDF_level;
-
- INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_Q, INTDRIVE_U, INTDRIVE_FLAG);
- EDF_level = EDF_register_level(EDF_ENABLE_ALL);
- posix_level=POSIX_register_level(RRTICK, 1, mb, 32);
- grubstar_level = GRUBSTAR_register_level(FSF_MAX_N_SERVERS, 1);
-
- FSF_register_module(posix_level,grubstar_level, (int)(MAX_BANDWIDTH * 0.8));
- dummy_register_level();
- //posix_level=POSIX_register_level(RRTICK, 1, mb, 32);
- CBS_register_level(CBS_ENABLE_ALL,EDF_level);
-
- SEM_register_module();
-
- pi_level=PI_register_module();
- pc_level=PC_register_module();
- NOP_register_module();
-
- PTHREAD_register_module(2, pi_level, pc_level);
-
- 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(0);
- }
-
-}
-
-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;
-}
-
-int main() {
-
- return start_environment();
-
-}
-
Index: trunk/loader/shark/shark.c
===================================================================
--- trunk/loader/shark/shark.c (revision 1609)
+++ trunk/loader/shark/shark.c (nonexistent)
@@ -1,267 +0,0 @@
-#include "func.h"
-#include "calibrate.h"
-#include <tracer.h>
-
-#include "FTrace_udp.h"
-#include "FTrace_chunk.h"
-
-extern int cal_cycles;
-extern struct timespec zero_time;
-extern struct loader_task loader_task_list[];
-extern struct loader_contract loader_contract_list[];
-extern int total_loader_task;
-extern int total_loader_contract;
-extern unsigned int clk_per_msec;
-
-mutex_t mutex_table[MAX_MUTEX];
-int main_chunk;
-
-/* Runtime Calibration */
-int calibrate_cycle()
-{
- long long i;
- struct timespec start,end,diff;
-
- if (cal_cycles != 0) return 0;
-
- kern_cli();
- __asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
- "cpuid\n\t"
- :::"eax","ebx","ecx","edx");
- kern_gettime(&start);
- for (i=0;i<CALIBRATION_DELTA;i++)
- __asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
- "cpuid\n\t"
- :::"eax","ebx","ecx","edx");
- __asm__ __volatile__ ("xorl %%eax,%%eax\n\t"
- "cpuid\n\t"
- :::"eax","ebx","ecx","edx");
- kern_gettime(&end);
- kern_sti();
-
- SUBTIMESPEC(&end,&start,&diff);
- cal_cycles = TIMESPEC2USEC(&diff);
- cprintf("Calibration usec/[%d cycles] = %d\n",CALIBRATION_DELTA,cal_cycles);
-
- return 0;
-
-}
-
-int get_server_from_contract(int contract)
-{
-
- int i;
-
- for(i=0;i<total_loader_contract;i++)
- if (loader_contract_list[i].number == contract)
- return loader_contract_list[i].server;
-
- return -1;
-
-}
-
-void *get_task_model(struct loader_task *current) {
- if (current->local_scheduler == PAR_POSIX) {
- static NRT_TASK_MODEL nrt;
- static fsf_sched_params_t pr;
-
- pr.policy=FSF_RR;
- pr.params=&nrt;
-
- nrt_task_default_model(nrt);
- nrt_task_def_save_arrivals(nrt);
- nrt_task_def_ctrl_jet(nrt);
- nrt_task_def_group(nrt,current->group);
- nrt_task_def_usemath(nrt);
-
- return &pr;
-
- }
-
- if (current->local_scheduler == PAR_EDF) {
- static HARD_TASK_MODEL ht;
- static fsf_sched_params_t pr;
-
- pr.policy=FSF_EDF;
- pr.params=&ht;
-
- hard_task_default_model(ht);
- hard_task_def_ctrl_jet(ht);
- hard_task_def_mit(ht,TIMESPEC2USEC(&current->deadline));
- hard_task_def_wcet(ht,TIMESPEC2USEC(&current->wcet));
- hard_task_def_group(ht,current->group);
- hard_task_def_aperiodic(ht);
- hard_task_def_usemath(ht);
- return &pr;
- }
-
- if (current->local_scheduler == PAR_NONE) {
- static DUMMY_TASK_MODEL d;
- static fsf_sched_params_t pr;
-
- pr.policy=FSF_NONE;
- pr.params=&d;
-
- dummy_task_default_model(d);
- dummy_task_def_group(d,current->group);
-
- return &pr;
- }
-
-
- if (current->local_scheduler == PAR_RM) {
- static HARD_TASK_MODEL ht;
- static fsf_sched_params_t pr;
-
- pr.policy=FSF_FP;
- pr.params=&ht;
-
- hard_task_default_model(ht);
- hard_task_def_mit(ht,TIMESPEC2USEC(&current->deadline));
- hard_task_def_wcet(ht,TIMESPEC2USEC(&current->wcet));
- hard_task_def_ctrl_jet(ht);
- hard_task_def_group(ht,current->group);
- hard_task_def_usemath(ht);
-
- return &pr;
- }
-
- return NULL;
-
-}
-
-TASK finish_task() {
-
- #ifdef __NEW_TRACER__
-
- //FTrace_OSD_init_udp(1,"192.168.82.43","192.168.82.205");
- FTrace_OSD_init_udp(1, "192.168.82.205", "192.168.82.43");
-
- FTrace_send_chunk(main_chunk, 0, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
-
- exit(0);
-
- #else
-
- exit(0);
-
- #endif
-
- return NULL;
-
-}
-
-void end_simulation() {
-
- #ifdef __NEW_TRACER__
-
- int i;
- struct loader_task *l = loader_task_list;
-
- NRT_TASK_MODEL nrt;
-
- TRACER_LOGEVENT(FTrace_EVT_trace_stop,0,0);
-
- FTrace_disable();
-
- i = 0;
- while (i < total_loader_task) {
-
- group_kill(l->group);
-
- i++;
- l=&loader_task_list[i];
-
- }
-
- nrt_task_default_model(nrt);
-
- task_activate(task_create("Finish",finish_task,&nrt,NULL));
-
- #else
-
- exit(0);
-
- #endif
-
-}
-
-void set_simulation_time (struct timespec *total) {
- struct timespec end_time;
-
- ADDTIMESPEC(&zero_time,total,&end_time);
- kern_event_post(&end_time,(void *)((void *)(end_simulation)),NULL);
-
-}
-
-/* Set the zero_time and post the first activation event */
-void start_simulation() {
-
- int i;
- struct loader_task *l = loader_task_list;
- struct timespec end_time;
- PISTAR_mutexattr_t a;
-
- PISTAR_mutexattr_default(a);
-
- i = 0;
-
- #ifdef __NEW_TRACER__
-
- main_chunk = FTrace_chunk_create(10000000, 1000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
-
- FTrace_actual_chunk_select(main_chunk);
-
- FTrace_enable();
-
- #endif
-
- //TRACER_LOGEVENT(FTrace_EVT_trace_start,0,0);
-
- 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);
- i = 0;
-
- kern_gettime(&zero_time);
-
- while (i < total_loader_task) {
-
- if (l->muxstatus == 1) {
- mutex_init(&mutex_table[l->resource],&a);
- l->muxstatus = 2;
- }
-
- if (l->act_number > 0) {
- ADDTIMESPEC(&zero_time, &l->act[0], &end_time);
- l->act_current++;
- kern_event_post(&end_time,(void *)((void *)(loader_task_activate)),l);
- }
-
- i++;
- l=&loader_task_list[i];
-
- }
-
-}
-
-/* Activate task and post the new activation event */
-void loader_task_activate(struct loader_task *l) {
-
- struct timespec actual_time,end_time;
-
- kern_gettime(&actual_time);
- group_activate(l->group);
-
- if (l->act_number > l->act_current) {
-
- ADDTIMESPEC(&actual_time, &l->act[l->act_current], &end_time);
-
- l->act_current++;
- kern_event_post(&end_time,(void *)((void *)(loader_task_activate)),l);
-
- }
-
-}