Lazuli
Loading...
Searching...
No Matches
Functions | Variables
kernel.c File Reference

Kernel entry point. More...

#include <stdint.h>
#include <Lazuli/common.h>
#include <Lazuli/config.h>
#include <Lazuli/sys/arch/arch.h>
#include <Lazuli/sys/compiler.h>
#include <Lazuli/sys/kernel.h>
#include <Lazuli/sys/linker.h>
#include <Lazuli/sys/memory.h>
#include <Lazuli/sys/scheduler.h>

Go to the source code of this file.

Functions

void main (void)
 Main entry point for user tasks.
 
void Kernel_Main (void)
 This is the kernel entry point.
 
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_FLAG_IN_KERNEL
 System status "register" (bit field).
 
AllocationMap kernelAllocationMap
 Allocation map for the kernel.
 

Detailed Description

Kernel entry point.

This file describes all the kernel routines such as:

It also holds the kernel memory allocation map.

Definition in file kernel.c.

Function Documentation

◆ main()

void main ( void  )

Main entry point for user tasks.

This is the function the user has to define to register his own tasks.

This prototype differs from the standard "int main(void)" as the return value is useless here.

◆ Kernel_Main()

void Kernel_Main ( void  )

This is the kernel entry point.

This function must never return.

Definition at line 54 of file kernel.c.

◆ 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

System status "register" (bit field).

Definition at line 45 of file kernel.c.

◆ kernelAllocationMap

AllocationMap kernelAllocationMap

Allocation map for the kernel.

Definition at line 47 of file kernel.c.