]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/RiscV64/ReadTimer.S
MdePkg/BaseLib: RISC-V: Add few more helper functions
[mirror_edk2.git] / MdePkg / Library / BaseLib / RiscV64 / ReadTimer.S
CommitLineData
550f196e
S
1//------------------------------------------------------------------------------\r
2//\r
3// Read CPU timer\r
4//\r
5// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
6//\r
7// SPDX-License-Identifier: BSD-2-Clause-Patent\r
8//\r
9//------------------------------------------------------------------------------\r
10\r
11#include <Register/RiscV64/RiscVImpl.h>\r
12\r
13.data\r
14.align 3\r
15.section .text\r
16\r
17//\r
18// Read TIME CSR.\r
19// @retval a0 : 64-bit timer.\r
20//\r
21ASM_FUNC (RiscVReadTimer)\r
22 csrr a0, CSR_TIME\r
23 ret\r