Esempio n. 1
0
long sys_sched_yield(va_list ap)
{
#ifdef CONFIG_KERNEL_RT
    return -ENOSYS;
#else
    seL4_Yield();
    return 0;
#endif
}
Esempio n. 2
0
static int
suspend_test_helper_2b(seL4_CPtr *t1, seL4_CPtr *t2a, seL4_CPtr *t2b)
{
    /* Wait for 2a to get suspend_test_step set to 1. */
    test_check(suspend_test_step == 0 || suspend_test_step == 1);
    while (suspend_test_step == 0) {
        seL4_Yield();
    }

    /* Timer tick should bring us back here. */
    CHECK_STEP(suspend_test_step, 1);

    /* Now spin and wait for us to be suspended. */
    while (suspend_test_step == 2) {
        seL4_Yield();
    }

    /* When we wake up suspend_test_step should be 4. */
    CHECK_STEP(suspend_test_step, 4);

    return sel4test_get_result();
}
Esempio n. 3
0
File: client.c Progetto: seL4/camkes
int run() {

    IPRINT("--- Starting ---\n");

    while (acc < MAX_VALUE) {
        /* do calculations to waste time */
        acc *= 17;
        acc++;
        acc /= 17;
        acc++;
        if (acc % RATE == 0) {
            IPRINT("acc = %"PRIuPTR"\n", acc);
            seL4_Yield();
        }
    }

    IPRINT("*** DONE %"PRIuPTR" ***\n", acc);

    return 0;
}
Esempio n. 4
0
static int
suspend_test_helper_1(seL4_CPtr *t1, seL4_CPtr *t2a, seL4_CPtr *t2b)
{
    CHECK_STEP(suspend_test_step, 3);

    /* Our sole job is to wake up 2b. */
    int error = seL4_TCB_Resume(*t2b);
    test_check(!error);

    /* We should have been preempted immediately, so by the time we run again,
     * the suspend_test_step should be 5. */

#if 1 // WE HAVE A BROKEN SCHEDULER IN SEL4
    /* FIXME: The seL4 scheduler is broken, and seL4_TCB_Resume will not
     * preempt. The only way to get preempted is to force it ourselves (or wait
     * for a timer tick). */
    seL4_Yield();
#endif

    CHECK_STEP(suspend_test_step, 5);

    return sel4test_get_result();
}
Esempio n. 5
0
int run(void) {
    int i;
    unsigned long int ii;
    /* Give the collector a chance to register. */
	for (i = 0; i < 25; i++) {
		seL4_Yield();
	}
	ev_emit();


	printf("starting to emit a lot...\n");
	ii = 0;
	while (1) {
		ii++;
		ev_emit();

		if (ii % 10000 == 0) {
			printf("still emitting\n");
		}
	}

    return 0;
}
Esempio n. 6
0
long sys_sched_yield(va_list ap) {
    seL4_Yield();
    return 0;
}