ubinos
Functions
bsp.h File Reference

ubinos BSP (Board Support Package) API More...

#include <ubinos_config.h>
#include <ubinos/type.h>
#include <ubinos/bsp/arch.h>
#include <ubinos/bsp/dtty.h>
#include <ubinos/bsp/intr.h>

Go to the source code of this file.

Functions

int appmain (int argc, char *argv[])
 
int bsp_comp_init (void)
 
int bsp_isintr (void)
 
int bsp_getcpuclockfreq (unsigned int *freq_p)
 
int bsp_getcpuclockfreqk (unsigned int *freqk_p)
 
int bsp_getmckfreq (unsigned int *freq_p)
 
int bsp_getmckfreqk (unsigned int *freqk_p)
 
int bsp_getcpuid (unsigned char *buf, int max)
 
int bsp_getcpuidsize (void)
 
void bsp_enableintr (void)
 
void bsp_disableintr (void)
 
void bsp_abortsystem (void)
 
int bsp_getstacksize (int type, unsigned int *stacksize_p)
 
int bsp_getmaxstackusage (int type, unsigned int *maxstackusage_p)
 
void bsp_busywait (unsigned int count)
 
void bsp_busywaitms (unsigned int timems)
 
unsigned int bsp_getbusywaitcountperms (void)
 
unsigned int bsp_timemstobwc (unsigned int timems)
 
unsigned int bsp_bwctotimems (unsigned int count)
 

Detailed Description

ubinos BSP (Board Support Package) API

BSP UBIK (Board Support Package for Kernel) API.

ubinos BSP (Board Support Package) API를 정의합니다.

BSP 에서 사용하는 Kernel 인터페이스를 정의합니다.

Function Documentation

◆ appmain()

int appmain ( int  argc,
char *  argv[] 
)

응용 코드 시작 함수

응용 코드의 시작점이 되는 함수 입니다. 응용 개발자가 직접 만들어주어야 하며, 시스템 시작시 BSP 컴포넌트의 main 함수에서 자동적으로 호출됩니다.

Parameters
argc매개변수 배열 argv의 길이

argv매개변수 배열 (BSP 컴포넌트 작성자가 임의로 정의함)

Returns
0: 성공

-1: 오류

◆ bsp_abortsystem()

void bsp_abortsystem ( void  )

시스템을 중지시키는 함수

◆ bsp_busywait()

void bsp_busywait ( unsigned int  count)

◆ bsp_busywaitms()

void bsp_busywaitms ( unsigned int  timems)

CPU를 점유한 채로 기다리는 함수 (천분의 일초 단위)

Parameters
timems기다릴 시간 (천분의 일초)

◆ bsp_bwctotimems()

unsigned int bsp_bwctotimems ( unsigned int  count)

busy wait count를 시간으로 변환하는 함수

Parameters
countbusy wait count

Returns
시간(천분의 일초)

◆ bsp_comp_init()

int bsp_comp_init ( void  )

BSP 컴포넌트를 초기화하는 함수

이 함수는 시스템 시작시 main 함수에서 자동적으로 호출됩니다.

Returns
0: 성공

-1: 오류

◆ bsp_disableintr()

void bsp_disableintr ( void  )

모든 인터럽트를 비활성화하는 함수

◆ bsp_enableintr()

void bsp_enableintr ( void  )

모든 인터럽트를 활성화하는 함수

intr_enable 함수로 활성화된 번호의 인터럽트만 활성화함

◆ bsp_getbusywaitcountperms()

unsigned int bsp_getbusywaitcountperms ( void  )

◆ bsp_getcpuclockfreq()

int bsp_getcpuclockfreq ( unsigned int *  freq_p)

CPU 클럭 주파수(Hz)를 돌려주는 함수

Parameters
freq_pCPU 클럭 주파수(Hz)를 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getcpuclockfreqk()

int bsp_getcpuclockfreqk ( unsigned int *  freqk_p)

CPU 클럭 주파수(KHz)를 돌려주는 함수

Parameters
freqk_pCPU 클럭 주파수(KHz)를 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getcpuid()

int bsp_getcpuid ( unsigned char *  buf,
int  max 
)

CPU ID를 돌려주는 함수

Parameters
bufCPU ID를 저장할 버퍼

maxCPU ID를 저장할 버퍼의 최대 크기

Returns
CPU ID 크기

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getcpuidsize()

int bsp_getcpuidsize ( void  )

CPU ID의 크기를 돌려주는 함수

Returns
CPU ID 크기

-1: 오류

◆ bsp_getmaxstackusage()

int bsp_getmaxstackusage ( int  type,
unsigned int *  maxstackusage_p 
)

스택 사용량 최고 기록을 돌려주는 함수

Parameters
type스택 영역 종류

0: system
maxstackusage_p스택 사용량 최고 기록을 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getmckfreq()

int bsp_getmckfreq ( unsigned int *  freq_p)

마스터 클럭 주파수(Hz)를 돌려주는 함수

Parameters
freq_p마스터 클럭 주파수(Hz)를 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getmckfreqk()

int bsp_getmckfreqk ( unsigned int *  freqk_p)

마스터 클럭 주파수(KHz)를 돌려주는 함수

Parameters
freqk_p마스터 클럭 주파수(KHz)를 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_getstacksize()

int bsp_getstacksize ( int  type,
unsigned int *  stacksize_p 
)

스택 영역 크기를 돌려주는 함수

Parameters
type스택 영역 종류

0: system
stacksize_p스택 영역 크기를 저장할 변수의 주소

Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ bsp_isintr()

int bsp_isintr ( void  )

인터럽트 서비스 루틴을 수행 중인지 여부를 알려주는 함수

Returns
1: 인터럽트 서비스 루틴을 수행 중임
0: 인터럽트 서비스 루틴을 수행 중임이 아님

◆ bsp_timemstobwc()

unsigned int bsp_timemstobwc ( unsigned int  timems)

시간을 busy wait count로 변환하는 함수

Parameters
timems시간(천분의 일초)

Returns
busy wait count