Merge pull request #3498 from bigmagic123/add_soc_cntp

add soc timer cntpct
This commit is contained in:
Bernard Xiong 2020-04-07 15:32:44 +08:00 committed by GitHub
commit 1210a611de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,8 @@ static rt_uint64_t timerStep;
int rt_hw_get_gtimer_frq(void); int rt_hw_get_gtimer_frq(void);
void rt_hw_set_gtimer_val(rt_uint64_t value); void rt_hw_set_gtimer_val(rt_uint64_t value);
int rt_hw_get_gtimer_val(void);
int rt_hw_get_cntpct_val(void);
void rt_hw_gtimer_enable(void); void rt_hw_gtimer_enable(void);
void core0_timer_enable_interrupt_controller() void core0_timer_enable_interrupt_controller()

View File

@ -25,6 +25,20 @@ rt_hw_set_gtimer_val:
MSR CNTP_TVAL_EL0,X0 MSR CNTP_TVAL_EL0,X0
RET RET
/*
*get gtimer CNTP_TVAL_EL0 value
*/
.globl rt_hw_get_gtimer_val
rt_hw_get_gtimer_val:
MRS X0,CNTP_TVAL_EL0
RET
.globl rt_hw_get_cntpct_val
rt_hw_get_cntpct_val:
MRS X0, CNTPCT_EL0
RET
/* /*
*get gtimer frq value *get gtimer frq value
*/ */