source: soft/giet_vm/hello/main.c @ 387

Last change on this file since 387 was 387, checked in by alain, 10 years ago

Cosmetic

File size: 693 bytes
Line 
1#include "stdio.h"
2#include "hard_config.h"
3
4__attribute__((constructor)) void main()
5{
6        char                byte;
7    unsigned int    procid     = giet_procid();
8    unsigned int    cluster_xy = procid/NB_PROCS_MAX;
9    unsigned int    lpid       = procid%NB_PROCS_MAX;
10    unsigned int    x          = cluster_xy >> Y_WIDTH;
11    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
12
13    giet_tty_printf( "*** Starting task hello on processor[%d,%d,%d] at cycle %d\n\n", 
14                      x, y, lpid, giet_proctime() );
15
16        while (1)
17        {
18                giet_tty_printf(" hello world\n");
19        giet_tty_getc((void*)&byte);
20        if ( byte == 'q' ) giet_exit("quit command received");
21        }
22} // end main
23
Note: See TracBrowser for help on using the repository browser.