Lazuli
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
kernel.h File Reference

Kernel symbols definition. More...

#include <stdint.h>
#include <Lazuli/common.h>
#include <Lazuli/sys/kernel_asm.h>
#include <Lazuli/sys/memory.h>

Go to the source code of this file.

Macros

#define SYSTEM_STATUS_FLAG_IN_KERNEL    ((lz_system_status_t)POSITION(SYSTEM_STATUS_FLAG_IN_KERNEL_POSITION))
 The flag constant for the status "in kernel".
 
#define SYSTEM_STATUS_IS_IN_KERNEL   (systemStatus & SYSTEM_STATUS_FLAG_IN_KERNEL)
 Get a boolean value indicating if the system is curently in kernel mode.
 

Typedefs

typedef uint8_t lz_system_status_t
 The type used for the system status "register".
 

Functions

void Kernel_Panic (void)
 Kernel panic.
 
void Kernel_ManageFailure (void)
 Manage a failure that can happen in a function call.
 

Variables

volatile lz_system_status_t systemStatus
 System status "register" (bit field).
 
AllocationMap kernelAllocationMap
 Allocation map for the kernel.
 

Detailed Description

Kernel symbols definition.

This file declares symbols related to the kernel itself.

Definition in file kernel.h.

Macro Definition Documentation

◆ SYSTEM_STATUS_FLAG_IN_KERNEL

#define SYSTEM_STATUS_FLAG_IN_KERNEL    ((lz_system_status_t)POSITION(SYSTEM_STATUS_FLAG_IN_KERNEL_POSITION))

The flag constant for the status "in kernel".

Definition at line 39 of file kernel.h.

◆ SYSTEM_STATUS_IS_IN_KERNEL

#define SYSTEM_STATUS_IS_IN_KERNEL   (systemStatus & SYSTEM_STATUS_FLAG_IN_KERNEL)

Get a boolean value indicating if the system is curently in kernel mode.

Definition at line 45 of file kernel.h.

Typedef Documentation

◆ lz_system_status_t

The type used for the system status "register".

Definition at line 29 of file kernel.h.

Function Documentation

◆ Kernel_Panic()

void Kernel_Panic ( void  )

Kernel panic.

Take the appropriate decision according to the configuration: infinite loop, reset the system.

Definition at line 84 of file kernel.c.

◆ Kernel_ManageFailure()

void Kernel_ManageFailure ( void  )

Manage a failure that can happen in a function call.

Basically, this function does the following:

  • If we are running in the context of a task, then abort the running task.
  • If we are running in the kernel context, then kernel panic.

This function can be used after testing parameters in functions that can be called by both the kernel or user tasks (e.g. library functions).

Definition at line 95 of file kernel.c.

Variable Documentation

◆ systemStatus

volatile lz_system_status_t systemStatus
extern

System status "register" (bit field).

Definition at line 45 of file kernel.c.

◆ kernelAllocationMap

AllocationMap kernelAllocationMap
extern

Allocation map for the kernel.

Definition at line 47 of file kernel.c.