arch/x86_64: Remove FAR from chip folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
af00e016e9
commit
0bd9a66305
@ -67,7 +67,7 @@ const uintptr_t g_idle_topstack = (uintptr_t)&_ebss +
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||||
{
|
{
|
||||||
board_autoled_on(LED_HEAPALLOCATE);
|
board_autoled_on(LED_HEAPALLOCATE);
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ static void x86_64_stackdump(uint64_t sp, uint64_t stack_top)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_USBDUMP
|
#ifdef CONFIG_ARCH_USBDUMP
|
||||||
static int usbtrace_syslog(FAR const char *fmt, ...)
|
static int usbtrace_syslog(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
|
||||||
{
|
{
|
||||||
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
||||||
return 0;
|
return 0;
|
||||||
@ -115,7 +115,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
|||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_dumpstate(void)
|
static void up_dumpstate(void)
|
||||||
{
|
{
|
||||||
FAR struct tcb_s *rtcb = running_task();
|
struct tcb_s *rtcb = running_task();
|
||||||
uint64_t sp = up_getsp();
|
uint64_t sp = up_getsp();
|
||||||
uint64_t ustackbase;
|
uint64_t ustackbase;
|
||||||
uint64_t ustacksize;
|
uint64_t ustacksize;
|
||||||
|
@ -61,9 +61,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_DUMP_ON_EXIT
|
#ifdef CONFIG_DUMP_ON_EXIT
|
||||||
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
|
static void _up_dumponexit(struct tcb_s *tcb, void *arg)
|
||||||
{
|
{
|
||||||
FAR struct filelist *filelist;
|
struct filelist *filelist;
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
*
|
*
|
||||||
* void sim_timer_initialize(void): Initializes the timer facilities.
|
* void sim_timer_initialize(void): Initializes the timer facilities.
|
||||||
* Called early in the initialization sequence (by up_initialize()).
|
* Called early in the initialization sequence (by up_initialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
* int up_timer_cancel(void): Cancels the interval timer.
|
* int up_timer_cancel(void): Cancels the interval timer.
|
||||||
* int up_timer_start(FAR const struct timespec *ts): Start (or re-starts)
|
* int up_timer_start(const struct timespec *ts): Start (or re-starts)
|
||||||
* the interval timer.
|
* the interval timer.
|
||||||
*
|
*
|
||||||
* The RTOS will provide the following interfaces for use by the platform-
|
* The RTOS will provide the following interfaces for use by the platform-
|
||||||
@ -137,14 +137,14 @@ void up_timer_initialize(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint64_t up_ts2tick(FAR const struct timespec *ts)
|
static inline uint64_t up_ts2tick(const struct timespec *ts)
|
||||||
{
|
{
|
||||||
return ROUND_INT_DIV((uint64_t)ts->tv_nsec * x86_64_timer_freq,
|
return ROUND_INT_DIV((uint64_t)ts->tv_nsec * x86_64_timer_freq,
|
||||||
NS_PER_SEC) +
|
NS_PER_SEC) +
|
||||||
(uint64_t)ts->tv_sec * x86_64_timer_freq;
|
(uint64_t)ts->tv_sec * x86_64_timer_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void up_tick2ts(uint64_t tick, FAR struct timespec *ts)
|
static inline void up_tick2ts(uint64_t tick, struct timespec *ts)
|
||||||
{
|
{
|
||||||
ts->tv_sec = (tick / x86_64_timer_freq);
|
ts->tv_sec = (tick / x86_64_timer_freq);
|
||||||
ts->tv_nsec = (uint64_t)(ROUND_INT_DIV((tick % x86_64_timer_freq) *
|
ts->tv_nsec = (uint64_t)(ROUND_INT_DIV((tick % x86_64_timer_freq) *
|
||||||
@ -182,7 +182,7 @@ static inline void up_tmr_sync_down(void)
|
|||||||
* sim_timer_initialize() was called). This function is functionally
|
* sim_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, struct timespec *ts);
|
||||||
*
|
*
|
||||||
* when clockid is CLOCK_MONOTONIC.
|
* when clockid is CLOCK_MONOTONIC.
|
||||||
*
|
*
|
||||||
@ -207,7 +207,7 @@ static inline void up_tmr_sync_down(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timer_gettime(FAR struct timespec *ts)
|
int up_timer_gettime(struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t diff = (rdtsc() - g_start_tsc);
|
uint64_t diff = (rdtsc() - g_start_tsc);
|
||||||
up_tick2ts(diff, ts);
|
up_tick2ts(diff, ts);
|
||||||
@ -247,7 +247,7 @@ int up_timer_gettime(FAR struct timespec *ts)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timer_cancel(FAR struct timespec *ts)
|
int up_timer_cancel(struct timespec *ts)
|
||||||
{
|
{
|
||||||
up_tmr_sync_up();
|
up_tmr_sync_up();
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ int up_timer_cancel(FAR struct timespec *ts)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timer_start(FAR const struct timespec *ts)
|
int up_timer_start(const struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t ticks;
|
uint64_t ticks;
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ void up_timer_expire(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_alarm_cancel(FAR struct timespec *ts)
|
int up_alarm_cancel(struct timespec *ts)
|
||||||
{
|
{
|
||||||
up_tmr_sync_up();
|
up_tmr_sync_up();
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ int up_alarm_cancel(FAR struct timespec *ts)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_alarm_start(FAR const struct timespec *ts)
|
int up_alarm_start(const struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t ticks;
|
uint64_t ticks;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS_ALIGNED
|
#ifdef CONFIG_TLS_ALIGNED
|
||||||
/* The allocated stack size must not exceed the maximum possible for the
|
/* The allocated stack size must not exceed the maximum possible for the
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
|
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
|
||||||
{
|
{
|
||||||
/* Is there a stack allocated? */
|
/* Is there a stack allocated? */
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ int up_rtc_initialize(void)
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
int up_rtc_gettime(FAR struct timespec *tp)
|
int up_rtc_gettime(struct timespec *tp)
|
||||||
{
|
{
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ int up_rtc_gettime(FAR struct timespec *tp)
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
int up_rtc_settime(FAR const struct timespec *tp)
|
int up_rtc_settime(const struct timespec *tp)
|
||||||
{
|
{
|
||||||
/* What so ever.. */
|
/* What so ever.. */
|
||||||
|
|
||||||
|
@ -69,9 +69,9 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
|
||||||
{
|
{
|
||||||
FAR void *ret;
|
void *ret;
|
||||||
|
|
||||||
/* Align the frame_size */
|
/* Align the frame_size */
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
|||||||
|
|
||||||
/* Save the adjusted stack values in the struct tcb_s */
|
/* Save the adjusted stack values in the struct tcb_s */
|
||||||
|
|
||||||
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
|
tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||||
tcb->adj_stack_size -= frame_size;
|
tcb->adj_stack_size -= frame_size;
|
||||||
|
|
||||||
/* And return the pointer to the allocated region */
|
/* And return the pointer to the allocated region */
|
||||||
|
Loading…
Reference in New Issue
Block a user