Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1448 → Rev 1449

/demos/trunk/pse51/ptest1.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest1.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest1.c,v 1.2 2004-05-23 09:05:50 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:50 $
------------
 
Posix test 1:
159,12 → 159,6
return 0;
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
 
int main(int argc, char **argv)
{
int err;
172,14 → 166,7
pthread_t j1, j2, j3, j4;
union sigval value;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
 
/* main blocks signals for all the tasks */
sigfillset(&mask);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
/demos/trunk/pse51/ptest2.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest2.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest2.c,v 1.2 2004-05-23 09:05:51 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:51 $
------------
 
Posix test 2:
105,25 → 105,11
return 0;
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
 
int main(int argc, char **argv)
{
int err;
pthread_t j1, j2;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
 
cprintf("main: creating prova_key\n");
pthread_key_create(&prova_key, destr_key);
 
/demos/trunk/pse51/ptest3.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest3.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest3.c,v 1.2 2004-05-23 09:05:51 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:51 $
------------
 
Posix test 3:
88,11 → 88,6
sys_gettime(NULL));
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
void task_timer(union sigval value)
{
cprintf("task_timer: value = %d, time = %ldusec\n",
109,13 → 104,6
pthread_attr_t task_attr;
struct sched_param task_param;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
sig_act.sa_sigaction = (void *) signal_handler;
sig_act.sa_flags = SA_SIGINFO;
sigemptyset(&sig_act.sa_mask);
221,8 → 209,6
//kern_deliver_pending_signals();
}
 
 
 
cprintf("main: ending...\n");
 
return 0;
/demos/trunk/pse51/pinit.c
18,11 → 18,11
 
/**
------------
CVS : $Id: pinit.c,v 1.2 2003-10-07 09:30:18 giacomo Exp $
CVS : $Id: pinit.c,v 1.3 2004-05-23 09:05:50 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-10-07 09:30:18 $
Revision: $Revision: 1.3 $
Last update: $Date: 2004-05-23 09:05:50 $
------------
 
This is a minimal initialization file for the PSE51 profile.
62,14 → 62,11
#include "modules/sem.h"
#include "modules/hartport.h"
 
#include "drivers/keyb.h"
 
#include "pthread.h"
#include "time.h"
 
 
/*+ sysyem tick in us +*/
#define TICK 1000
#define TICK 0
 
/*+ RR tick in us +*/
#define RRTICK 10000
98,28 → 95,9
TASK __init__(void *arg)
{
struct multiboot_info *mb = (struct multiboot_info *)arg;
NRT_TASK_MODEL m; // the scheduling model for the Keyboard
 
KEYB_PARMS k = BASE_KEYB;
keyb_def_task(k, &m);
nrt_task_default_model(m);
nrt_task_def_arg(m,arg);
nrt_task_def_usemath(m);
nrt_task_def_ctrl_jet(m);
nrt_task_def_save_arrivals(m);
nrt_task_def_unjoinable(m);
nrt_task_def_weight(m, sched_get_priority_max(SCHED_RR));
nrt_task_def_policy(m,SCHED_RR);
nrt_task_def_inherit(m,PTHREAD_EXPLICIT_SCHED);
nrt_task_def_nokill(m);
nrt_task_def_system(m);
 
HARTPORT_init();
 
if (KEYB_init(&k) < 0)
kern_printf("Error during Keyboard Initialization!!!");
 
__call_main__(mb);
 
return (void *)0;
/demos/trunk/pse51/ptest4.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest4.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest4.c,v 1.2 2004-05-23 09:05:51 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:51 $
------------
 
Posix test 4:
98,12 → 98,7
cprintf("SIGNAL HANDLER: pid=%d\n",exec_shadow);
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
 
int main(int argc, char **argv)
{
int err;
110,13 → 105,6
pthread_t j1, j2, j3;
struct sigaction sig_act;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
sig_act.sa_sigaction = (void *) signal_handler;
sig_act.sa_flags = SA_SIGINFO;
sigemptyset(&sig_act.sa_mask);
/demos/trunk/pse51/ptest5.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest5.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest5.c,v 1.2 2004-05-23 09:05:51 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:51 $
------------
 
Posix test 5:
61,32 → 61,16
#include <unistd.h>
 
#include <kernel/kern.h>
#include <drivers/keyb.h>
 
 
 
void signal_handler(int signo, siginfo_t *info, void *extra)
{
cprintf("SIGNAL HANDLER: pid=%d\n",exec_shadow);
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
 
int main(int argc, char **argv)
{
struct sigaction sig_act;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
sig_act.sa_sigaction = (void *) signal_handler;
sig_act.sa_flags = SA_SIGINFO;
sigemptyset(&sig_act.sa_mask);
/demos/trunk/pse51/ptest6.c
18,11 → 18,11
 
/**
------------
CVS : $Id: ptest6.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
CVS : $Id: ptest6.c,v 1.2 2004-05-23 09:05:51 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:47 $
Revision: $Revision: 1.2 $
Last update: $Date: 2004-05-23 09:05:51 $
------------
 
Posix test 6:
86,7 → 86,6
#include <mqueue.h>
 
#include <kernel/kern.h>
#include <drivers/keyb.h>
 
struct sigevent ev25, evtask;
pthread_attr_t task_attr;
232,11 → 231,6
sys_gettime(NULL));
}
 
void fine(KEY_EVT *e)
{
sys_end();
}
 
int main(int argc, char **argv)
{
// int err;
243,13 → 237,6
struct sigaction sig_act;
struct mq_attr attr;
 
KEY_EVT emerg;
//keyb_set_map(itaMap);
emerg.ascii = 'x';
emerg.scan = KEY_X;
emerg.flag = ALTL_BIT;
keyb_hook(emerg,fine);
 
sig_act.sa_sigaction = (void *) signal_handler;
sig_act.sa_flags = SA_SIGINFO;
sigemptyset(&sig_act.sa_mask);