task2.c 641 Bytes
Newer Older
1 2 3 4 5
#include "system.h"
#include "printk.h"

rtems_task Task2_EntryPoint(rtems_task_argument argument)
{
6
    int j = 0;
7 8
    int task_no = (int) argument;
    long long int dummy = 0;
9 10 11

    printk("Inside task %d...\n", task_no);
    for(j=0; j<500000; j++) {
12 13 14 15 16
        int k;
        for(k=0; k<100; k++)
            dummy ^= k;
        dummy++;
    }
17 18 19 20 21 22 23 24 25
    if (dummy != 500000) {
        printk(
            "[TASK %d] Failed! Computed value was %lld instead of 500000\n",
            task_no, dummy);
        all_OK = 0;
        die(task_no, 1);
    }
    printk("[TASK %d] Computed the correct integer result.\n", task_no);
    die(task_no, 0);
26
}