BEEP-8 SDK 1.0.0
Loading...
Searching...
No Matches
os.h File Reference

OS definitions and system call interfaces for the BEEP-8 system. More...

#include <stddef.h>
#include <b8/type.h>

Go to the source code of this file.

Classes

struct  _b8OsBridgeUsr2Svc
 
struct  _b8OsConfig
 

Macros

#define B8_OS_INVALID_PID   (0)
 
#define B8_OS_INVALID_SID   (0)
 
#define B8_OS_SCHED_FIFO   1
 
#define B8_OS_SCHED_RR   2
 
#define B8_OS_SCHED_SPORADIC   3
 
#define B8_OS_SCHED_IRQ   4
 
#define B8_OS_SCHED_OTHER   5
 
#define B8_OS_NOT_USING_IRQ   (0xffff)
 
#define B8_OS_SEM_WAIT   (0)
 
#define B8_OS_SEM_TRYWAIT   (1)
 
#define B8_OS_SEM_TIMEDWAIT   (2)
 
#define B8_OS_CLOCKID_REALTIME   (0x10)
 
#define B8_OS_CLOCKID_MONOTONIC   (0x11)
 
#define B8_OS_CLOCKID_PROCESS_CPUTIME_ID   (0x12)
 
#define B8_OS_CLOCKID_THREAD_CPUTIME_ID   (0x13)
 
#define SEM_VALUE_MAX   (32767)
 

Typedefs

typedef u32 b8OsPid
 
typedef u32 b8OsSid
 
typedef u64 b8OsCpuCycles
 
typedef struct _b8OsBridgeUsr2Svc b8OsBridgeUsr2Svc
 
typedef struct _sem_t sem_t
 
typedef struct _b8OsConfig b8OsConfig
 

Enumerations

enum  b8OsSysCallNum {
  B8_OS_SYSCALL_NULL = 0 , B8_OS_SYSCALL_GET_BRIDGE , B8_OS_SYSCALL_SCHED_YIELD , B8_OS_SYSCALL_SCHED_SLEEP ,
  B8_OS_SYSCALL_THREAD_CREATE , B8_OS_SYSCALL_EXIT , B8_OS_SYSCALL_SET_ERRNO , B8_OS_SYSCALL_GET_ERRNO ,
  B8_OS_SYSCALL_SEM_INIT , B8_OS_SYSCALL_SEM_POST , B8_OS_SYSCALL_SEM_WAIT , B8_OS_SYSCALL_SEM_GETVALUE ,
  B8_OS_SYSCALL_CLOCK_GETRES , B8_OS_SYSCALL_CLOCK_GETTIME , B8_OS_SYSCALL_CLOCK_SETTIME , B8_OS_SYSCALL_MAX
}
 
enum  b8OsSysCallResultIdx { B8_OS_SYSCALL_THREAD_CREATE_PID =1 , B8_OS_SYSCALL_SEM_INIT_SID =1 , B8_OS_SYSCALL_SEM_GETVALUE_RESULT =1 }
 
enum  b8OsSysErrNo { B8_OS_OK = 0 , ERRBEGIN = 1000 , ERREND }
 

Functions

b8OsBridgeUsr2Svcb8OsGetBridge (void)
 
b8OsBridgeUsr2Svcb8OsSysCall (b8OsSysCallNum syscall, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
 
int b8OsReset (b8OsConfig *cfg_)
 
int b8OsIsRunning (void)
 

Detailed Description

OS definitions and system call interfaces for the BEEP-8 system.

This file contains the definitions and system call interfaces for the BEEP-8 operating system. It includes type definitions, constants for scheduling policies and clock IDs, system call enumerations, error codes, and function prototypes for system operations.

Typically, users do not need to use this file directly. It is primarily used by the BEEP-8 bootloader to manage OS-level functionalities such as process and semaphore handling, scheduling, and time management.