/advdemos/trunk/elastic/initfile.c |
---|
0,0 → 1,69 |
/* |
* 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 "kernel/kern.h" |
#include "modules/edf.h" |
#include "modules/elastic.h" |
#include "modules/rr.h" |
#include "modules/dummy.h" |
/*+ sysyem tick in us +*/ |
#define TICK 0 |
/*+ RR tick in us +*/ |
#define RRTICK 10000 |
TIME __kernel_register_levels__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
EDF_register_level(EDF_ENABLE_ALL); |
ELASTIC_register_level(ELASTIC_ENABLE_ALL, 0); |
RR_register_level(RRTICK, RR_MAIN_YES, mb); |
dummy_register_level(); |
return TICK; |
} |
TASK __init__(void *arg) |
{ |
struct multiboot_info *mb = (struct multiboot_info *)arg; |
__call_main__(mb); |
return (void *)0; |
} |
/advdemos/trunk/elastic/elastic.c |
---|
0,0 → 1,71 |
/* |
* Project: S.Ha.R.K. |
* |
* Coordinators: |
* Giorgio Buttazzo <giorgio@sssup.it> |
* Paolo Gai <pj@gandalf.sssup.it> |
* |
* Authors : |
* Giacomo Guidi <giacomo@gandalf.sssup.ti> |
* |
* 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" |
TASK elastic_test(void *arg) { |
while(1) { |
cprintf("X."); |
task_endcycle(); |
} |
} |
int main(int argc, char **argv) |
{ |
ELASTIC_TASK_MODEL e; |
PID el_pid; |
elastic_task_default_model(e); |
elastic_task_def_period(e, 10000, 100000); |
elastic_task_def_wcet(e, 4000); |
elastic_task_def_param(e, 0, 0); |
elastic_task_def_ctrl_jet(e); |
elastic_task_def_usemath(e); |
el_pid = task_create("Elastic Test",elastic_test,&e,NULL); |
if (el_pid == NIL) { |
cprintf("ERROR: Cannot create elastic task\n"); |
sys_end(); |
} |
task_activate(el_pid); |
return 0; |
} |
/advdemos/trunk/elastic/makefile |
---|
0,0 → 1,15 |
# |
# |
# |
ifndef BASE |
BASE=../.. |
endif |
include $(BASE)/config/config.mk |
PROGS = elastic |
include $(BASE)/config/example.mk |
elastic: |
make -f $(SUBMAKE) APP=elastic INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT= |