Changeset 407 for trunk/kernel/syscalls/sys_get_cycle.c
- Timestamp:
- Nov 7, 2017, 3:08:12 PM (7 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_get_cycle.c
r405 r407 1 1 /* 2 * sys_ clock: get calling core cycles count2 * sys_get_cycle.c - get calling core cycles count. 3 3 * 4 4 * Author Alain Greiner (2016,2017) … … 32 32 #include <printk.h> 33 33 34 ////////////////////////////////// 35 int sys_ clock (uint64_t * cycles)34 ////////////////////////////////////// 35 int sys_get_cycle ( uint64_t * cycle ) 36 36 { 37 37 error_t error; 38 38 paddr_t paddr; 39 uint64_t k_cycle s;39 uint64_t k_cycle; 40 40 41 41 thread_t * this = CURRENT_THREAD; … … 43 43 44 44 // check buffer in user space 45 error = vmm_v2p_translate( false , cycle s, &paddr );45 error = vmm_v2p_translate( false , cycle , &paddr ); 46 46 47 47 if( error ) … … 54 54 55 55 // call relevant core function 56 k_cycle s= hal_get_cycles();56 k_cycle = hal_get_cycles(); 57 57 58 58 // copy to user space 59 hal_copy_to_uspace( cycle s , &k_cycles, sizeof(uint64_t) );59 hal_copy_to_uspace( cycle , &k_cycle , sizeof(uint64_t) ); 60 60 61 61 return 0; 62 62 63 } // end sys_ clock()63 } // end sys_get_cycle()
Note: See TracChangeset
for help on using the changeset viewer.