52,9 → 52,9 |
tasklet_descriptor_t *tasklet_desc; |
//before we start we need to register a tasklet |
if (!gquiet) |
printf("Registering tasklet..."); |
printf("cpu:%d, Registering tasklet...", CPU->id); |
if (!gquiet) |
tasklet_desc=tasklet_register(&func, "\nTasklet called and received data from second thread\n"); |
tasklet_desc=tasklet_register(&func, "\nTasklet called and received data\n"); |
else |
tasklet_desc=tasklet_register(&func, ""); |
if (!gquiet) |
62,7 → 62,7 |
|
//first we'll try disabling the tasklet |
if (!gquiet) |
printf("Disabling tasklet..."); |
printf("cpu:%d, Disabling tasklet...", CPU->id); |
tasklet_disable(tasklet_desc); |
if (!gquiet) |
printf("Done!\n"); |
69,7 → 69,7 |
|
//we'll schedule the disabled tasklet |
if (!gquiet) |
printf("Scheduling tasklet..."); |
printf("cpu:%d, Scheduling tasklet...", CPU->id); |
tasklet_schedule(tasklet_desc); |
if (!gquiet) |
printf("Done!\n"); |
76,14 → 76,14 |
|
//and we'll wait if it gets called. It shouldn't however, because it's disabled |
if (!gquiet) |
printf("Waiting 1s...\n"); |
printf("cpu:%d, Waiting 1s...\n", CPU->id); |
waitq_sleep_timeout(&wq,(uint32_t) 1000000,0); |
if (!gquiet) |
printf("Done!\n"); |
printf("cpu:%d, Done!\n", CPU->id); |
|
//then we'll try to enable it |
if (!gquiet) |
printf("Enabling tasklet..."); |
printf("cpu:%d, Enabling tasklet...", CPU->id); |
tasklet_enable(tasklet_desc); |
if (!gquiet) |
printf("Done!\n"); |
90,14 → 90,14 |
|
//and wait if it gets called this time. It should because it's enabled |
if (!gquiet) |
printf("Waiting 1s...\n"); |
printf("cpu:%d, Waiting 1s...\n", CPU->id); |
waitq_sleep_timeout(&wq,(uint32_t) 1000000,0); |
if (!gquiet) |
printf("Done!\n"); |
printf("cpu:%d, Done!\n", CPU->id); |
|
//finally we'll free the tasklet structure |
if (!gquiet) |
printf("Freeing..."); |
printf("cpu:%d, Freeing...", CPU->id); |
tasklet_free(tasklet_desc); |
if (!gquiet) |
printf("Done!\n"); |
109,8 → 109,11 |
waitq_t wq; |
waitq_initialize(&wq); |
tasklet_descriptor_t *tasklet_desc; |
thread_t* second_thread; |
thread_t* second_thread = NULL; |
#ifdef CONFIG_SMP |
if (!quiet) |
printf("cpus:%d\n", config.cpu_active); |
|
if (config.cpu_active >1) { |
second_thread = thread_create(&running_tasklet, NULL, TASK, THREAD_FLAG_WIRED,"running tasklet", false); |
if (CPU->id == 0) |
123,7 → 126,7 |
|
//before we start we need to register a tasklet |
if (!quiet) |
printf("Registering tasklet..."); |
printf("cpu:%d, Registering tasklet...", CPU->id); |
if (!quiet) |
tasklet_desc=tasklet_register(&func, "\nTasklet called and received data\n"); |
else |
133,7 → 136,7 |
|
//first we'll try disabling the tasklet |
if (!quiet) |
printf("Disabling tasklet..."); |
printf("cpu:%d, Disabling tasklet...", CPU->id); |
tasklet_disable(tasklet_desc); |
if (!quiet) |
printf("Done!\n"); |
140,7 → 143,7 |
|
//we'll schedule the disabled tasklet |
if (!quiet) |
printf("Scheduling tasklet..."); |
printf("cpu:%d, Scheduling tasklet...", CPU->id); |
tasklet_schedule(tasklet_desc); |
if (!quiet) |
printf("Done!\n"); |
147,14 → 150,15 |
|
//and we'll wait if it gets called. It shouldn't however, because it's disabled |
if (!quiet) |
printf("Waiting 1s...\n"); |
printf("cpu:%d, Waiting 1s...\n", CPU->id); |
waitq_sleep_timeout(&wq,(uint32_t) 1000000,0); |
if (!quiet) |
printf("Done!\n"); |
printf("cpu:%d, Done!\n", CPU->id); |
|
|
//then we'll try to enable it |
if (!quiet) |
printf("Enabling tasklet..."); |
printf("cpu:%d, Enabling tasklet...", CPU->id); |
tasklet_enable(tasklet_desc); |
if (!quiet) |
printf("Done!\n"); |
161,14 → 165,21 |
|
//and wait if it gets called this time. It should because it's enabled |
if (!quiet) |
printf("Waiting 1s...\n"); |
printf("cpu:%d, Waiting 1s...\n", CPU->id); |
waitq_sleep_timeout(&wq,(uint32_t) 1000000,0); |
if (!quiet) |
printf("Done!\n"); |
printf("cpu:%d, Done!\n", CPU->id); |
#ifdef CONFIG_SMP |
if (config.cpu_active >1) { |
printf("Joining with the second thread..."); |
thread_join(second_thread); |
printf("Done\n"); |
} |
|
#endif |
//finally we'll free the tasklet structure |
if (!quiet) |
printf("Freeing..."); |
printf("cpu:%d, Freeing...", CPU->id); |
tasklet_free(tasklet_desc); |
if (!quiet) |
printf("Done!\n"); |