19 #if defined(CONF_CRITICAL_SECTIONS) 35 .global _locked_check_and_increment\n\ 36 _locked_check_and_increment:\n\ 101 #endif // CONF_CRITICAL_SECTIONS Interface: kernel level critical sections.
kernel configuration file
volatile unsigned char atomic_t
The data type that allows for atomic count operations.
int locked_check_and_increment(atomic_t *counter, tdata_t **tid)
check and increment counter, without interruptions
Internal Interface: task management.
Interface: reduced UNIX standard library.
int enter_critical_section(critsec_t *cs)
lock a critical section, or wait until it is available.
unsigned long wakeup_t
wakeup data area type
atomic_t kernel_critsec_count
critical section counter for kernel/task manager
critical section data structure
__asm__("\.text\.global _locked_check_and_increment\ _locked_check_and_increment:\ push.w r4\ stc ccr, r4h\ orc #0x80, ccr\ mov.b @r0, r4l\ beq lci_get_lock\\ push.w r2\ push.w r3\ mov.w @_ctid, r2\ mov.w @r1, r3\ sub.w r3, r2\ bne lci_cant_lock\\ pop.w r3\ pop.w r2\ bra lci_get_lock\\ lci_cant_lock:\ pop.w r3\ pop.w r2\ mov.w #0xffff, r0\ bra lci_done\\ lci_get_lock:\ inc r4l\ mov.b r4l, @r0\ mov.w @_ctid, r0 \ mov.w r0, @r1 \ sub.w r0, r0\\ lci_done:\ ldc r4h, ccr\ pop.w r4\ rts\ ")
wakeup_t wait_critical_section(wakeup_t data)
wakeup when critical section is available
wakeup_t wait_event(wakeup_t(*wakeup)(wakeup_t), wakeup_t data)