summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseLib/RiscV64/ReadTimer.S
blob: 39a06efa51ef9294f3737d4e226e4d964d44449f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//------------------------------------------------------------------------------
//
// Read CPU timer
//
// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
//------------------------------------------------------------------------------

#include <Register/RiscV64/RiscVImpl.h>

.data
.align 3
.section .text

//
// Read TIME CSR.
// @retval a0 : 64-bit timer.
//
ASM_FUNC (RiscVReadTimer)
    csrr a0, CSR_TIME
    ret