Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_tasklet.c
Context not available. | |||||
#define TASKLET_ST_BUSY 1 | #define TASKLET_ST_BUSY 1 | ||||
#define TASKLET_ST_EXEC 2 | #define TASKLET_ST_EXEC 2 | ||||
#define TASKLET_ST_LOOP 3 | #define TASKLET_ST_LOOP 3 | ||||
#define TASKLET_ST_PAUSED 4 | |||||
#define TASKLET_ST_CMPSET(ts, old, new) \ | #define TASKLET_ST_CMPSET(ts, old, new) \ | ||||
atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) | atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) | ||||
Context not available. | |||||
while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) | while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) | ||||
pause("W", 1); | pause("W", 1); | ||||
} | } | ||||
void tasklet_enable(struct tasklet_struct *ts) | |||||
{ | |||||
while (1) { | |||||
hselasky: This function doesn't do anything. | |||||
Done Inline ActionsGood catch! That could explain some of the bugs I'm seeing. johalun0_gmail.com: Good catch! That could explain some of the bugs I'm seeing. | |||||
if (TASKLET_ST_GET(ts) != TASKLET_ST_PAUSED) | |||||
break; | |||||
if (TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE)) | |||||
break; | |||||
pause("W", 1); | |||||
} | |||||
} | |||||
void tasklet_disable(struct tasklet_struct *ts) | |||||
{ | |||||
while (1) { | |||||
if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) | |||||
break; | |||||
if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) | |||||
break; | |||||
pause("W", 1); | |||||
} | |||||
} | |||||
Context not available. |
This function doesn't do anything.