critsec.h File Reference

Interface: kernel level critical sections. More...

#include <config.h>
#include <atomic.h>
Include dependency graph for critsec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INITIALIZE_KERNEL_CRITICAL_SECTION()   kernel_critsec_count=0
 
#define ENTER_KERNEL_CRITICAL_SECTION()   atomic_inc(&kernel_critsec_count)
 
#define LEAVE_KERNEL_CRITICAL_SECTION()   atomic_dec(&kernel_critsec_count)
 
#define DESTROY_KERNEL_CRITICAL_SECTION()
 

Variables

atomic_t kernel_critsec_count
 critical section counter for kernel/task manager More...
 

Detailed Description

Interface: kernel level critical sections.

Author
Joseph A. Woolley jawoo.nosp@m.lley.nosp@m.@user.nosp@m.s.so.nosp@m.urcef.nosp@m.orge.nosp@m..net

Defines types and functions used for kernel level critical sections.

Definition in file critsec.h.

Macro Definition Documentation

◆ DESTROY_KERNEL_CRITICAL_SECTION

#define DESTROY_KERNEL_CRITICAL_SECTION ( )

Definition at line 43 of file critsec.h.

◆ ENTER_KERNEL_CRITICAL_SECTION

#define ENTER_KERNEL_CRITICAL_SECTION ( )    atomic_inc(&kernel_critsec_count)

Definition at line 41 of file critsec.h.

◆ INITIALIZE_KERNEL_CRITICAL_SECTION

#define INITIALIZE_KERNEL_CRITICAL_SECTION ( )    kernel_critsec_count=0

Definition at line 40 of file critsec.h.

◆ LEAVE_KERNEL_CRITICAL_SECTION

#define LEAVE_KERNEL_CRITICAL_SECTION ( )    atomic_dec(&kernel_critsec_count)

Definition at line 42 of file critsec.h.

Variable Documentation

◆ kernel_critsec_count

atomic_t kernel_critsec_count

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. This is checked in the task_switch_handler() in systime.c

Definition at line 17 of file critsec.c.


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.8.13