307 lines
7.1 KiB
C
Raw Normal View History

2023-07-13 11:27:03 +08:00
#ifndef __SMARTOS_H__
#define __SMARTOS_H__
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef void (*start_hook_func)(int);
typedef void (*irq_handler)();
typedef enum
{
smart_all_irq,
smart_fun_s,
smart_fun_e,
smart_clear_cnt_error,
smart_irq_check_error
}smart_irq_cnt_type_t;
/*
smart_kernel_init
: usr_startup
: cpuid
void
smart系统初始化接口
2023-07-13 11:27:03 +08:00
*/
extern void smart_kernel_init(start_hook_func *usr_startup,int cpuid);
/*
smart_irq_enable
: vector
int
0
0
使intmask
2023-07-13 11:27:03 +08:00
*/
int smart_irq_enable(uint32_t vector);
/*
smart_irq_disable
: vector
int
0
0
intmask
2023-07-13 11:27:03 +08:00
*/
int smart_irq_disable(uint32_t vector);
/*
smart_irq_request
: vector
: func
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_irq_request(uint32_t vector,irq_handler func);
/*
smart_irq_free
vector
0: 0
2023-07-13 11:27:03 +08:00
*/
extern int smart_irq_free(uint32_t vector);
/*
smart_int_disable
2023-07-13 11:27:03 +08:00
*/
extern void smart_int_disable();
/*
smart_int_enable
2023-07-13 11:27:03 +08:00
*/
extern void smart_int_enable();
/*
smart_get_curprio
:
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_get_curprio();
/*
smart_get_cpuid
:
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_get_cpuid();
/*
smart_task_create
: void (*task)(void *p_arg)
*p_arg
*ptos;
prio
id id
*pbos
stk_size;
int
0
2023-07-13 11:27:03 +08:00
*/
extern uint8_t smart_task_create (void (*task)(void *p_arg),
void *p_arg,
uint32_t *ptos,
uint8_t prio,
uint16_t id,
uint32_t *pbos,
uint32_t stk_size);
/*
smart_tick_sleep
: cycle
: int
tick
2023-07-13 11:27:03 +08:00
*/
extern void smart_tick_sleep(int cycle);
/*
smart_task_del
: prio
: int
int
0
使
;
2023-07-13 11:27:03 +08:00
*/
extern int smart_task_del(int prio);
2023-07-13 11:27:03 +08:00
/*****************************************************************
sem relation
****************************************************************/
/******************************************
smart_sem_create
: cnt
: int
void *
2023-07-13 11:27:03 +08:00
*****************************************/
extern void *smart_sem_create(int cnt);
/******************************************
smart_sem_pend
: void *sem
: void *
2023-07-13 11:27:03 +08:00
*****************************************/
extern void smart_sem_pend(void *sem);
/******************************************
smart_sem_post
: void *sem
: void *
0 0
2023-07-13 11:27:03 +08:00
*****************************************/
extern int smart_sem_post(void *sem);
/*******************************************
smart_sem_del
: void *sem
: void *
0 0
:
2023-07-13 11:27:03 +08:00
******************************************/
extern int smart_sem_del(void *sem);
extern int smart_get_reg_prio(int *buf);
/*
smart_reclaim_init_res
void
*/
extern void smart_reclaim_init_res();
2023-07-13 11:27:03 +08:00
/*
smart_irq_debug_init
debug_base_addr buf
len_bytes buf
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_irq_debug_init(uint32_t debug_base_addr, uint32_t len_bytes);
/*
smart_irq_get_type_cnt
num_type
irq_cnt_type_t
2023-07-13 11:27:03 +08:00
typedef enum
{
all_irq,
fun_s,
fun_e,
clear_cnt_error,
irq_check_error
}irq_cnt_type_t;
uint32_t
0
0
2023-07-13 11:27:03 +08:00
*/
extern uint32_t smart_irq_get_type_cnt(smart_irq_cnt_type_t num_type);
/*
smart_irq_get_run_cnt
irqnum
2023-07-13 11:27:03 +08:00
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_irq_get_run_cnt(uint32_t irqnum);
/*
smart_os_debug_init
debug_base_addr buf
len_bytes buf ,0x40
int
0
0
2023-07-13 11:27:03 +08:00
*/
extern int smart_os_debug_init( uint32_t debug_base_addr, uint32_t len_bytes);
/*
smart_no_idle_sw_init
debug_base_addr buf
lens buf 0x40
int
0
0
,idle
*/
extern int smart_no_idle_sw_init(uint32_t debug_base_addr, uint32_t lens);
2023-07-13 11:27:03 +08:00
#endif