TianoCore EDK2 master
Loading...
Searching...
No Matches
Csr.c File Reference

Go to the source code of this file.

Functions

UINTN AsmCsrRead (IN UINT16 Select)
 
UINTN AsmCsrWrite (IN UINT16 Select, IN UINTN Value)
 
UINTN AsmCsrXChg (IN UINT16 Select, IN UINTN Value, IN UINTN Mask)
 
UINTN EFIAPI CsrRead (IN UINT16 Select)
 
UINTN EFIAPI CsrWrite (IN UINT16 Select, IN OUT UINTN Value)
 
UINTN EFIAPI CsrXChg (IN UINT16 Select, IN OUT UINTN Value, IN UINTN Mask)
 

Detailed Description

LoongArch CSR operation functions.

Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Csr.c.

Function Documentation

◆ CsrRead()

UINTN EFIAPI CsrRead ( IN UINT16  Select)

CSR read operation.

Parameters
[in]SelectCSR read instruction select values.
Returns
The return value of csrrd instruction, if a break exception is triggered, the Select is out of support.

Definition at line 37 of file Csr.c.

◆ CsrWrite()

UINTN EFIAPI CsrWrite ( IN UINT16  Select,
IN OUT UINTN  Value 
)

CSR write operation.

Parameters
[in]SelectCSR write instruction select values.
[in,out]ValueThe csrwr will write the value.
Returns
The return value of csrwr instruction, that is, store the old value of the register, if a break exception is triggered, the Select is out of support.

Definition at line 55 of file Csr.c.

◆ CsrXChg()

UINTN EFIAPI CsrXChg ( IN UINT16  Select,
IN OUT UINTN  Value,
IN UINTN  Mask 
)

CSR exchange operation.

Parameters
[in]SelectCSR exchange instruction select values.
[in,out]ValueThe csrxchg will write the value.
[in]MaskThe csrxchg mask value.
Returns
The return value of csrxchg instruction, that is, store the old value of the register, if a break exception is triggered, the Select is out of support.

Definition at line 75 of file Csr.c.