Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1262 → Rev 1261

/demos/trunk/loader/common/nload.c
31,18 → 31,12
{
long long i,exec_cycles = 0;
struct loader_task *l = (struct loader_task *)(arg);
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
char tmp[20];
#endif
#endif
char tmp[20];
 
if (l->act_current == 0) l->act_current = 1;
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
sprintf(tmp,"[ONESHOT]");
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
sprintf(tmp,"[ONESHOT]");
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
 
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
70,22 → 64,15
long long i,exec_cycles = 0;
int act = 0;
struct loader_task *l = (struct loader_task *)(arg);
char tmp[20];
 
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
char tmp[20];
#endif
#endif
 
if (l->act_current == 0) l->act_current = 1;
 
while(1) {
 
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
sprintf(tmp,"C[%06d]",act);
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
sprintf(tmp,"C[%06d]",act);
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
118,11 → 105,7
long long i,exec_cycles = 0;
int act = 0;
struct loader_task *l = (struct loader_task *)(arg);
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
char tmp[20];
#endif
#endif
char tmp[20];
 
if (l->act_current == 0) l->act_current = 1;
 
129,10 → 112,8
while(1) {
 
#ifdef TASK_OUTPUT
#ifdef OS_SHARK
sprintf(tmp,"B[%06d]",act);
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
sprintf(tmp,"B[%06d]",act);
printf_xy((get_current_exec_task() % 5) * 9 + 34,get_current_exec_task() / 5 + 5, GREEN, tmp);
#endif
exec_cycles = (long long)(TIMESPEC2USEC(&l->exec[l->act_current-1])) * CALIBRATION_DELTA / cal_cycles;
168,6 → 149,16
switch(current->task_type) {
case PAR_TASK_OS:
 
/* generic_task_create(
server number,
pthread_t of created task (-1 if failed),
pthread_attr_t,
task_body,
arg of the body (must be "(void *)current"),
arg for real-time task specification)
*/
 
err = generic_create_thread(generic_get_server_from_contract(current->contract),&j,NULL,
oneshot_task,(void *)current,generic_get_task_model(current));
break;