Update reserved function names starting with one underscore, replacing them as follows: '_k_' with 'z_' '_K_' with 'Z_' '_handler_' with 'z_handl_' '_Cstart' with 'z_cstart' '_Swap' with 'z_swap' This renaming is done on both global and those static function names in kernel/include and include/. Other static function names in kernel/ are renamed by removing the leading underscore. Other function names not starting with any prefix listed above are renamed starting with a 'z_' or 'Z_' prefix. Function names starting with two or three leading underscores are not automatcally renamed since these names will collide with the variants with two or three leading underscores. Various generator scripts have also been updated as well as perf, linker and usb files. These are drivers/serial/uart_handlers.c include/linker/kobject-text.ld kernel/include/syscall_handler.h scripts/gen_kobject_list.py scripts/gen_syscall_header.py Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
39 lines
704 B
C
39 lines
704 B
C
/*
|
|
* Copyright (c) 2017 Synopsys, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Time Stamp API for ARCv2
|
|
*
|
|
* Provide 64-bit time stamp API
|
|
*/
|
|
|
|
#include <kernel.h>
|
|
#include <toolchain.h>
|
|
#include <kernel_structs.h>
|
|
|
|
/*
|
|
* @brief Read 64-bit timestamp value
|
|
*
|
|
* This function returns a 64-bit bit time stamp value that is clocked
|
|
* at the same frequency as the CPU.
|
|
*
|
|
* @return 64-bit time stamp value
|
|
*/
|
|
u64_t z_tsc_read(void)
|
|
{
|
|
unsigned int key;
|
|
u64_t t;
|
|
u32_t count;
|
|
|
|
key = irq_lock();
|
|
t = (u64_t)z_tick_get();
|
|
count = z_arc_v2_aux_reg_read(_ARC_V2_TMR0_COUNT);
|
|
irq_unlock(key);
|
|
t *= (u64_t)sys_clock_hw_cycles_per_tick();
|
|
t += (u64_t)count;
|
|
return t;
|
|
}
|