#include "config.h"
#include <sys/critsec.h>
#include <unistd.h>
#include <sys/tm.h>
#include <tm.h>
Include dependency graph for critsec.c:
Go to the source code of this file.
Functions | |
int | locked_increment (unsigned char *counter) |
increment counter without interruption | |
__asm__ (".text.globl _locked_increment _locked_increment:stc ccr, r1h orc#0x80, ccr mov.b @r0, r1l inc r1l mov.b r1l,@r0 ldc r1h, ccr sub r0, r0 rts") | |
int | locked_decrement (unsigned char *counter) |
decrement counter without interruption | |
__asm__ (".text.globl _locked_decrement _locked_decrement:stc ccr, r1h orc#0x80, ccr mov.b @r0, r1l dec r1l mov.b r1l,@r0 ldc r1h, ccr sub r0, r0 rts") | |
int | locked_check_and_increment (unsigned char *counter, tdata_t **tid) |
check and increment counter, without interruptions | |
__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 | |
int | enter_critical_section (critsec_t *cs) |
enter critical section | |
Variables | |
volatile unsigned char | kernel_critsec_count |
critical section counter for kernel/task manager |
|
|
|
|
|
Referenced by dbutton(), disable_irqs(), enable_irqs(), lcd_clear(), lcd_hide(), lcd_show(), power_init(), power_off(), sound_playing(), and sound_system(). |
|
enter critical section check and lock critical section if it is available; otherwise, wait until it is available, then lock it.
Definition at line 144 of file critsec.c. References critsec::count, locked_check_and_increment(), critsec::task, wait_critical_section(), wait_event(), and wakeup_t. |
|
check and increment counter, without interruptions increments counter if count is already zero, or if this is the same task as the one that made it one. used to enter a normal critical section.
Referenced by enter_critical_section(), and wait_critical_section(). |
|
decrement counter without interruption locks interrupts except NMI, decrements count then restores interrupts. used to leave both normal and kernel critical sections.
|
|
increment counter without interruption locks interrupts except NMI, then increments the count and restores intrrupts. primarily used to enter kernel critical section.
|
|
wakeup when critical section is available wakeup function used to detect when a critical section is available. called while processing an interrupt, so interrupts are already disabled. Definition at line 126 of file critsec.c. References critsec::count, locked_check_and_increment(), critsec::task, and wakeup_t. Referenced by enter_critical_section(). |
|
critical section counter for kernel/task manager when the critical section counter is Zero, task swapping is allowed. when greater than zero, task swapping is not allowed. |
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |