MdePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,148 +1,148 @@
|
||||
#
|
||||
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
#
|
||||
# This program and the accompanying materials are licensed and made available
|
||||
# under the terms and conditions of the BSD License which accompanies this
|
||||
# distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#
|
||||
|
||||
.text
|
||||
.align 3
|
||||
|
||||
GCC_ASM_EXPORT(MmioRead8Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite8Internal)
|
||||
GCC_ASM_EXPORT(MmioRead16Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite16Internal)
|
||||
GCC_ASM_EXPORT(MmioRead32Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite32Internal)
|
||||
GCC_ASM_EXPORT(MmioRead64Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite64Internal)
|
||||
|
||||
//
|
||||
// Reads an 8-bit MMIO register.
|
||||
//
|
||||
// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead8Internal):
|
||||
ldrb w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes an 8-bit MMIO register.
|
||||
//
|
||||
// Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite8Internal):
|
||||
dmb st
|
||||
strb w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 16-bit MMIO register.
|
||||
//
|
||||
// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead16Internal):
|
||||
ldrh w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 16-bit MMIO register.
|
||||
//
|
||||
// Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite16Internal):
|
||||
dmb st
|
||||
strh w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 32-bit MMIO register.
|
||||
//
|
||||
// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead32Internal):
|
||||
ldr w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 32-bit MMIO register.
|
||||
//
|
||||
// Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite32Internal):
|
||||
dmb st
|
||||
str w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 64-bit MMIO register.
|
||||
//
|
||||
// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead64Internal):
|
||||
ldr x0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 64-bit MMIO register.
|
||||
//
|
||||
// Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite64Internal):
|
||||
dmb st
|
||||
str x1, [x0]
|
||||
ret
|
||||
#
|
||||
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
#
|
||||
# This program and the accompanying materials are licensed and made available
|
||||
# under the terms and conditions of the BSD License which accompanies this
|
||||
# distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#
|
||||
|
||||
.text
|
||||
.align 3
|
||||
|
||||
GCC_ASM_EXPORT(MmioRead8Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite8Internal)
|
||||
GCC_ASM_EXPORT(MmioRead16Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite16Internal)
|
||||
GCC_ASM_EXPORT(MmioRead32Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite32Internal)
|
||||
GCC_ASM_EXPORT(MmioRead64Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite64Internal)
|
||||
|
||||
//
|
||||
// Reads an 8-bit MMIO register.
|
||||
//
|
||||
// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead8Internal):
|
||||
ldrb w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes an 8-bit MMIO register.
|
||||
//
|
||||
// Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite8Internal):
|
||||
dmb st
|
||||
strb w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 16-bit MMIO register.
|
||||
//
|
||||
// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead16Internal):
|
||||
ldrh w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 16-bit MMIO register.
|
||||
//
|
||||
// Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite16Internal):
|
||||
dmb st
|
||||
strh w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 32-bit MMIO register.
|
||||
//
|
||||
// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead32Internal):
|
||||
ldr w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 32-bit MMIO register.
|
||||
//
|
||||
// Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite32Internal):
|
||||
dmb st
|
||||
str w1, [x0]
|
||||
ret
|
||||
|
||||
//
|
||||
// Reads a 64-bit MMIO register.
|
||||
//
|
||||
// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead64Internal):
|
||||
ldr x0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
//
|
||||
// Writes a 64-bit MMIO register.
|
||||
//
|
||||
// Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite64Internal):
|
||||
dmb st
|
||||
str x1, [x0]
|
||||
ret
|
||||
|
@@ -1,149 +1,149 @@
|
||||
;
|
||||
; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
;
|
||||
; This program and the accompanying materials are licensed and made available
|
||||
; under the terms and conditions of the BSD License which accompanies this
|
||||
; distribution. The full text of the license may be found at
|
||||
; http:;opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
|
||||
|
||||
AREA IoLibMmio, CODE, READONLY
|
||||
|
||||
EXPORT MmioRead8Internal
|
||||
EXPORT MmioWrite8Internal
|
||||
EXPORT MmioRead16Internal
|
||||
EXPORT MmioWrite16Internal
|
||||
EXPORT MmioRead32Internal
|
||||
EXPORT MmioWrite32Internal
|
||||
EXPORT MmioRead64Internal
|
||||
EXPORT MmioWrite64Internal
|
||||
|
||||
;
|
||||
; Reads an 8-bit MMIO register.
|
||||
;
|
||||
; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead8Internal
|
||||
ldrb w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes an 8-bit MMIO register.
|
||||
;
|
||||
; Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite8Internal
|
||||
dmb st
|
||||
strb w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 16-bit MMIO register.
|
||||
;
|
||||
; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead16Internal
|
||||
ldrh w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 16-bit MMIO register.
|
||||
;
|
||||
; Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite16Internal
|
||||
dmb st
|
||||
strh w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 32-bit MMIO register.
|
||||
;
|
||||
; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead32Internal
|
||||
ldr w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 32-bit MMIO register.
|
||||
;
|
||||
; Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite32Internal
|
||||
dmb st
|
||||
str w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 64-bit MMIO register.
|
||||
;
|
||||
; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead64Internal
|
||||
ldr x0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 64-bit MMIO register.
|
||||
;
|
||||
; Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite64Internal
|
||||
dmb st
|
||||
str x1, [x0]
|
||||
ret
|
||||
|
||||
END
|
||||
;
|
||||
; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
;
|
||||
; This program and the accompanying materials are licensed and made available
|
||||
; under the terms and conditions of the BSD License which accompanies this
|
||||
; distribution. The full text of the license may be found at
|
||||
; http:;opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
|
||||
|
||||
AREA IoLibMmio, CODE, READONLY
|
||||
|
||||
EXPORT MmioRead8Internal
|
||||
EXPORT MmioWrite8Internal
|
||||
EXPORT MmioRead16Internal
|
||||
EXPORT MmioWrite16Internal
|
||||
EXPORT MmioRead32Internal
|
||||
EXPORT MmioWrite32Internal
|
||||
EXPORT MmioRead64Internal
|
||||
EXPORT MmioWrite64Internal
|
||||
|
||||
;
|
||||
; Reads an 8-bit MMIO register.
|
||||
;
|
||||
; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead8Internal
|
||||
ldrb w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes an 8-bit MMIO register.
|
||||
;
|
||||
; Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite8Internal
|
||||
dmb st
|
||||
strb w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 16-bit MMIO register.
|
||||
;
|
||||
; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead16Internal
|
||||
ldrh w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 16-bit MMIO register.
|
||||
;
|
||||
; Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite16Internal
|
||||
dmb st
|
||||
strh w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 32-bit MMIO register.
|
||||
;
|
||||
; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead32Internal
|
||||
ldr w0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 32-bit MMIO register.
|
||||
;
|
||||
; Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite32Internal
|
||||
dmb st
|
||||
str w1, [x0]
|
||||
ret
|
||||
|
||||
;
|
||||
; Reads a 64-bit MMIO register.
|
||||
;
|
||||
; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead64Internal
|
||||
ldr x0, [x0]
|
||||
dmb ld
|
||||
ret
|
||||
|
||||
;
|
||||
; Writes a 64-bit MMIO register.
|
||||
;
|
||||
; Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite64Internal
|
||||
dmb st
|
||||
str x1, [x0]
|
||||
ret
|
||||
|
||||
END
|
||||
|
@@ -1,145 +1,145 @@
|
||||
#
|
||||
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
#
|
||||
# This program and the accompanying materials are licensed and made available
|
||||
# under the terms and conditions of the BSD License which accompanies this
|
||||
# distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#
|
||||
|
||||
GCC_ASM_EXPORT(MmioRead8Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite8Internal)
|
||||
GCC_ASM_EXPORT(MmioRead16Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite16Internal)
|
||||
GCC_ASM_EXPORT(MmioRead32Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite32Internal)
|
||||
GCC_ASM_EXPORT(MmioRead64Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite64Internal)
|
||||
|
||||
//
|
||||
// Reads an 8-bit MMIO register.
|
||||
//
|
||||
// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead8Internal):
|
||||
ldrb r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes an 8-bit MMIO register.
|
||||
//
|
||||
// Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite8Internal):
|
||||
dmb st
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 16-bit MMIO register.
|
||||
//
|
||||
// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead16Internal):
|
||||
ldrh r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 16-bit MMIO register.
|
||||
//
|
||||
// Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite16Internal):
|
||||
dmb st
|
||||
strh r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 32-bit MMIO register.
|
||||
//
|
||||
// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead32Internal):
|
||||
ldr r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 32-bit MMIO register.
|
||||
//
|
||||
// Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite32Internal):
|
||||
dmb st
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 64-bit MMIO register.
|
||||
//
|
||||
// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead64Internal):
|
||||
ldrd r0, r1, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 64-bit MMIO register.
|
||||
//
|
||||
// Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite64Internal):
|
||||
dmb st
|
||||
strd r2, r3, [r0]
|
||||
bx lr
|
||||
#
|
||||
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
#
|
||||
# This program and the accompanying materials are licensed and made available
|
||||
# under the terms and conditions of the BSD License which accompanies this
|
||||
# distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#
|
||||
|
||||
GCC_ASM_EXPORT(MmioRead8Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite8Internal)
|
||||
GCC_ASM_EXPORT(MmioRead16Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite16Internal)
|
||||
GCC_ASM_EXPORT(MmioRead32Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite32Internal)
|
||||
GCC_ASM_EXPORT(MmioRead64Internal)
|
||||
GCC_ASM_EXPORT(MmioWrite64Internal)
|
||||
|
||||
//
|
||||
// Reads an 8-bit MMIO register.
|
||||
//
|
||||
// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead8Internal):
|
||||
ldrb r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes an 8-bit MMIO register.
|
||||
//
|
||||
// Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite8Internal):
|
||||
dmb st
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 16-bit MMIO register.
|
||||
//
|
||||
// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead16Internal):
|
||||
ldrh r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 16-bit MMIO register.
|
||||
//
|
||||
// Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite16Internal):
|
||||
dmb st
|
||||
strh r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 32-bit MMIO register.
|
||||
//
|
||||
// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead32Internal):
|
||||
ldr r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 32-bit MMIO register.
|
||||
//
|
||||
// Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite32Internal):
|
||||
dmb st
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Reads a 64-bit MMIO register.
|
||||
//
|
||||
// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
// returned. This function must guarantee that all MMIO read and write
|
||||
// operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to read.
|
||||
//
|
||||
// @return The value read.
|
||||
//
|
||||
ASM_PFX(MmioRead64Internal):
|
||||
ldrd r0, r1, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
//
|
||||
// Writes a 64-bit MMIO register.
|
||||
//
|
||||
// Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
// by Value and returns Value. This function must guarantee that all MMIO read
|
||||
// and write operations are serialized.
|
||||
//
|
||||
// @param Address The MMIO register to write.
|
||||
// @param Value The value to write to the MMIO register.
|
||||
//
|
||||
ASM_PFX(MmioWrite64Internal):
|
||||
dmb st
|
||||
strd r2, r3, [r0]
|
||||
bx lr
|
||||
|
@@ -1,149 +1,149 @@
|
||||
;
|
||||
; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
;
|
||||
; This program and the accompanying materials are licensed and made available
|
||||
; under the terms and conditions of the BSD License which accompanies this
|
||||
; distribution. The full text of the license may be found at
|
||||
; http:;opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
|
||||
|
||||
AREA IoLibMmio, CODE, READONLY
|
||||
|
||||
EXPORT MmioRead8Internal
|
||||
EXPORT MmioWrite8Internal
|
||||
EXPORT MmioRead16Internal
|
||||
EXPORT MmioWrite16Internal
|
||||
EXPORT MmioRead32Internal
|
||||
EXPORT MmioWrite32Internal
|
||||
EXPORT MmioRead64Internal
|
||||
EXPORT MmioWrite64Internal
|
||||
|
||||
;
|
||||
; Reads an 8-bit MMIO register.
|
||||
;
|
||||
; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead8Internal
|
||||
ldrb r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes an 8-bit MMIO register.
|
||||
;
|
||||
; Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite8Internal
|
||||
dmb st
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 16-bit MMIO register.
|
||||
;
|
||||
; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead16Internal
|
||||
ldrh r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 16-bit MMIO register.
|
||||
;
|
||||
; Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite16Internal
|
||||
dmb st
|
||||
strh r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 32-bit MMIO register.
|
||||
;
|
||||
; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead32Internal
|
||||
ldr r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 32-bit MMIO register.
|
||||
;
|
||||
; Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite32Internal
|
||||
dmb st
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 64-bit MMIO register.
|
||||
;
|
||||
; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead64Internal
|
||||
ldrd r0, r1, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 64-bit MMIO register.
|
||||
;
|
||||
; Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite64Internal
|
||||
dmb st
|
||||
strd r2, r3, [r0]
|
||||
bx lr
|
||||
|
||||
END
|
||||
;
|
||||
; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
|
||||
;
|
||||
; This program and the accompanying materials are licensed and made available
|
||||
; under the terms and conditions of the BSD License which accompanies this
|
||||
; distribution. The full text of the license may be found at
|
||||
; http:;opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
|
||||
|
||||
AREA IoLibMmio, CODE, READONLY
|
||||
|
||||
EXPORT MmioRead8Internal
|
||||
EXPORT MmioWrite8Internal
|
||||
EXPORT MmioRead16Internal
|
||||
EXPORT MmioWrite16Internal
|
||||
EXPORT MmioRead32Internal
|
||||
EXPORT MmioWrite32Internal
|
||||
EXPORT MmioRead64Internal
|
||||
EXPORT MmioWrite64Internal
|
||||
|
||||
;
|
||||
; Reads an 8-bit MMIO register.
|
||||
;
|
||||
; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead8Internal
|
||||
ldrb r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes an 8-bit MMIO register.
|
||||
;
|
||||
; Writes the 8-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite8Internal
|
||||
dmb st
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 16-bit MMIO register.
|
||||
;
|
||||
; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead16Internal
|
||||
ldrh r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 16-bit MMIO register.
|
||||
;
|
||||
; Writes the 16-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite16Internal
|
||||
dmb st
|
||||
strh r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 32-bit MMIO register.
|
||||
;
|
||||
; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead32Internal
|
||||
ldr r0, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 32-bit MMIO register.
|
||||
;
|
||||
; Writes the 32-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite32Internal
|
||||
dmb st
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Reads a 64-bit MMIO register.
|
||||
;
|
||||
; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
|
||||
; returned. This function must guarantee that all MMIO read and write
|
||||
; operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to read.
|
||||
;
|
||||
; @return The value read.
|
||||
;
|
||||
MmioRead64Internal
|
||||
ldrd r0, r1, [r0]
|
||||
dmb
|
||||
bx lr
|
||||
|
||||
;
|
||||
; Writes a 64-bit MMIO register.
|
||||
;
|
||||
; Writes the 64-bit MMIO register specified by Address with the value specified
|
||||
; by Value and returns Value. This function must guarantee that all MMIO read
|
||||
; and write operations are serialized.
|
||||
;
|
||||
; @param Address The MMIO register to write.
|
||||
; @param Value The value to write to the MMIO register.
|
||||
;
|
||||
MmioWrite64Internal
|
||||
dmb st
|
||||
strd r2, r3, [r0]
|
||||
bx lr
|
||||
|
||||
END
|
||||
|
@@ -26,7 +26,7 @@
|
||||
FILE_GUID = 926c9cd0-4bb8-479b-9ac4-8a2a23f85307
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = IoLib
|
||||
LIBRARY_CLASS = IoLib
|
||||
|
||||
|
||||
#
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# I/O Library that uses compiler intrinsics to perform IN and OUT instructions
|
||||
# for IA-32 and x64.
|
||||
#
|
||||
# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
#
|
||||
@@ -24,7 +24,7 @@
|
||||
FILE_GUID = 93742f95-6e71-4581-b600-8e1da443f95a
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = IoLib
|
||||
LIBRARY_CLASS = IoLib
|
||||
|
||||
|
||||
#
|
||||
|
@@ -4,7 +4,7 @@
|
||||
All assertions for bit field operations are handled bit field functions in the
|
||||
Base Library.
|
||||
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -80,7 +80,7 @@ IoAnd8 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 8-bit I/O port.
|
||||
|
||||
Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
|
||||
@@ -146,7 +146,7 @@ IoBitFieldRead8 (
|
||||
|
||||
Writes Value to the bit field of the I/O register. The bit field is specified
|
||||
by the StartBit and the EndBit. All other bits in the destination I/O
|
||||
register are preserved. The value written to the I/O port is returned.
|
||||
register are preserved. The value written to the I/O port is returned.
|
||||
|
||||
If 8-bit I/O port operations are not supported, then ASSERT().
|
||||
If StartBit is greater than 7, then ASSERT().
|
||||
@@ -348,7 +348,7 @@ IoOr16 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param AndData The value to AND with the read value from the I/O port.
|
||||
|
||||
@@ -366,7 +366,7 @@ IoAnd16 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 16-bit I/O port.
|
||||
|
||||
Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
|
||||
@@ -378,7 +378,7 @@ IoAnd16 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param AndData The value to AND with the read value from the I/O port.
|
||||
@param OrData The value to OR with the result of the AND operation.
|
||||
@@ -659,7 +659,7 @@ IoAnd32 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 32-bit I/O port.
|
||||
|
||||
Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
|
||||
@@ -952,7 +952,7 @@ IoAnd64 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 64-bit I/O port.
|
||||
|
||||
Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
|
||||
@@ -1190,7 +1190,7 @@ IoBitFieldAndThenOr64 (
|
||||
Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
|
||||
result back to the 8-bit MMIO register.
|
||||
|
||||
Reads the 8-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 8-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 8-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -1243,7 +1243,7 @@ MmioAnd8 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 8-bit MMIO register.
|
||||
|
||||
Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
|
||||
@@ -1347,7 +1347,7 @@ MmioBitFieldWrite8 (
|
||||
Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
|
||||
writes the result back to the bit field in the 8-bit MMIO register.
|
||||
|
||||
Reads the 8-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 8-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 8-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -1477,7 +1477,7 @@ MmioBitFieldAndThenOr8 (
|
||||
Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
|
||||
result back to the 16-bit MMIO register.
|
||||
|
||||
Reads the 16-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 16-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 16-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -1532,7 +1532,7 @@ MmioAnd16 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 16-bit MMIO register.
|
||||
|
||||
Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
|
||||
@@ -1638,7 +1638,7 @@ MmioBitFieldWrite16 (
|
||||
Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
|
||||
writes the result back to the bit field in the 16-bit MMIO register.
|
||||
|
||||
Reads the 16-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 16-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 16-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -1771,7 +1771,7 @@ MmioBitFieldAndThenOr16 (
|
||||
Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
|
||||
result back to the 32-bit MMIO register.
|
||||
|
||||
Reads the 32-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 32-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 32-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -1826,7 +1826,7 @@ MmioAnd32 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 32-bit MMIO register.
|
||||
|
||||
Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
|
||||
@@ -1932,7 +1932,7 @@ MmioBitFieldWrite32 (
|
||||
Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
|
||||
writes the result back to the bit field in the 32-bit MMIO register.
|
||||
|
||||
Reads the 32-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 32-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 32-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -2065,7 +2065,7 @@ MmioBitFieldAndThenOr32 (
|
||||
Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
|
||||
result back to the 64-bit MMIO register.
|
||||
|
||||
Reads the 64-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 64-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 64-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
@@ -2120,7 +2120,7 @@ MmioAnd64 (
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
|
||||
OR, and writes the result back to the 64-bit MMIO register.
|
||||
|
||||
Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
|
||||
@@ -2226,7 +2226,7 @@ MmioBitFieldWrite64 (
|
||||
Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
|
||||
writes the result back to the bit field in the 64-bit MMIO register.
|
||||
|
||||
Reads the 64-bit MMIO register specified by Address, performs a bitwise
|
||||
Reads the 64-bit MMIO register specified by Address, performs a bitwise
|
||||
OR between the read result and the value specified by OrData, and
|
||||
writes the result to the 64-bit MMIO register specified by Address. The value
|
||||
written to the MMIO register is returned. This function must guarantee that
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Common I/O Library routines.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -107,7 +107,7 @@ MmioRead8 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -169,7 +169,7 @@ MmioRead16 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -185,7 +185,7 @@ MmioWrite16 (
|
||||
MemoryFence ();
|
||||
*(volatile UINT16*)Address = Value;
|
||||
MemoryFence ();
|
||||
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ MmioRead32 (
|
||||
UINT32 Value;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT32*)Address;
|
||||
MemoryFence ();
|
||||
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ MmioRead32 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -245,11 +245,11 @@ MmioWrite32 (
|
||||
)
|
||||
{
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
|
||||
MemoryFence ();
|
||||
*(volatile UINT32*)Address = Value;
|
||||
MemoryFence ();
|
||||
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ MmioRead64 (
|
||||
UINT64 Value;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT64*)Address;
|
||||
MemoryFence ();
|
||||
@@ -307,11 +307,11 @@ MmioWrite64 (
|
||||
)
|
||||
{
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
|
||||
MemoryFence ();
|
||||
*(volatile UINT64*)Address = Value;
|
||||
MemoryFence ();
|
||||
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
I/O Library for ARM.
|
||||
I/O Library for ARM.
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
We don't advocate putting compiler specifics in libraries or drivers but there
|
||||
is no other way to make this work.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -116,7 +116,7 @@ IoRead16 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -145,7 +145,7 @@ IoWrite16 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to read.
|
||||
|
||||
@return The value read.
|
||||
@@ -174,7 +174,7 @@ IoRead32 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
I/O Library. This file has compiler specifics for ICC as there
|
||||
is no ANSI C standard for doing IO.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are
|
||||
licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -73,7 +73,7 @@ IoWrite8 (
|
||||
mov dx, word ptr [Port]
|
||||
out dx, al
|
||||
}
|
||||
return Value;
|
||||
return Value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ IoRead16 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -153,7 +153,7 @@ IoWrite16 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to read.
|
||||
|
||||
@return The value read.
|
||||
@@ -174,7 +174,7 @@ IoRead32 (
|
||||
in eax, dx
|
||||
mov dword ptr [Data], eax
|
||||
}
|
||||
|
||||
|
||||
return Data;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ IoRead32 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -202,7 +202,7 @@ IoWrite32 (
|
||||
)
|
||||
{
|
||||
ASSERT ((Port & 3) == 0);
|
||||
|
||||
|
||||
__asm {
|
||||
mov eax, dword ptr [Value]
|
||||
mov dx, word ptr [Port]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Common I/O Library routines.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
This function translates I/O port address to memory address by adding the 64MB
|
||||
aligned I/O Port space to the I/O address.
|
||||
If I/O Port space base is not 64MB aligned, then ASSERT ().
|
||||
If I/O Port space base is not 64MB aligned, then ASSERT ().
|
||||
|
||||
@param Port The I/O port to read.
|
||||
|
||||
@@ -46,7 +46,7 @@ InternalGetMemoryMapAddress (
|
||||
|
||||
//
|
||||
// Make sure that the I/O Port space base is 64MB aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((IoBlockBaseAddress & 0x3ffffff) == 0);
|
||||
Address += IoBlockBaseAddress;
|
||||
|
||||
@@ -109,7 +109,7 @@ IoRead16 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to read.
|
||||
|
||||
@return The value read.
|
||||
@@ -184,7 +184,7 @@ IoWrite8 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -210,7 +210,7 @@ IoWrite16 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -508,7 +508,7 @@ MmioRead16 (
|
||||
|
||||
//
|
||||
// Make sure that Address is 16-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
@@ -545,7 +545,7 @@ MmioRead32 (
|
||||
|
||||
//
|
||||
// Make sure that Address is 32-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
@@ -582,7 +582,7 @@ MmioRead64 (
|
||||
|
||||
//
|
||||
// Make sure that Address is 64-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
@@ -606,7 +606,7 @@ MmioRead64 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -638,7 +638,7 @@ MmioWrite8 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -651,7 +651,7 @@ MmioWrite16 (
|
||||
{
|
||||
//
|
||||
// Make sure that Address is 16-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
@@ -675,7 +675,7 @@ MmioWrite16 (
|
||||
|
||||
@param Address The MMIO register to write.
|
||||
@param Value The value to write to the MMIO register.
|
||||
|
||||
|
||||
@return Value.
|
||||
|
||||
**/
|
||||
@@ -688,7 +688,7 @@ MmioWrite32 (
|
||||
{
|
||||
//
|
||||
// Make sure that Address is 32-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
@@ -723,7 +723,7 @@ MmioWrite64 (
|
||||
{
|
||||
//
|
||||
// Make sure that Address is 64-bit aligned.
|
||||
//
|
||||
//
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Address |= BIT63;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
I/O Library MMIO Buffer Functions.
|
||||
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -17,11 +17,11 @@
|
||||
/**
|
||||
Copy data from the MMIO region to system memory by using 8-bit access.
|
||||
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 8-bit access. The total
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 8-bit access. The total
|
||||
number of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ MmioReadBuffer8 (
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
|
||||
while (Length-- != 0) {
|
||||
*(Buffer++) = MmioRead8 (StartAddress++);
|
||||
}
|
||||
@@ -57,13 +57,13 @@ MmioReadBuffer8 (
|
||||
/**
|
||||
Copy data from the MMIO region to system memory by using 16-bit access.
|
||||
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 16-bit access. The total
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 16-bit access. The total
|
||||
number of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 16-bit boundary, then ASSERT().
|
||||
@@ -87,15 +87,15 @@ MmioReadBuffer16 (
|
||||
UINT16 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead16 (StartAddress);
|
||||
StartAddress += sizeof (UINT16);
|
||||
@@ -108,13 +108,13 @@ MmioReadBuffer16 (
|
||||
/**
|
||||
Copy data from the MMIO region to system memory by using 32-bit access.
|
||||
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 32-bit access. The total
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 32-bit access. The total
|
||||
number of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 32-bit boundary, then ASSERT().
|
||||
@@ -138,15 +138,15 @@ MmioReadBuffer32 (
|
||||
UINT32 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead32 (StartAddress);
|
||||
StartAddress += sizeof (UINT32);
|
||||
@@ -159,13 +159,13 @@ MmioReadBuffer32 (
|
||||
/**
|
||||
Copy data from the MMIO region to system memory by using 64-bit access.
|
||||
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 64-bit access. The total
|
||||
Copy data from the MMIO region specified by starting address StartAddress
|
||||
to system memory specified by Buffer by using 64-bit access. The total
|
||||
number of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 64-bit boundary, then ASSERT().
|
||||
@@ -189,15 +189,15 @@ MmioReadBuffer64 (
|
||||
UINT64 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead64 (StartAddress);
|
||||
StartAddress += sizeof (UINT64);
|
||||
@@ -211,11 +211,11 @@ MmioReadBuffer64 (
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 8-bit access.
|
||||
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 8-bit access. The total number
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 8-bit access. The total number
|
||||
of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
|
||||
|
||||
|
||||
@@ -238,27 +238,27 @@ MmioWriteBuffer8 (
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
|
||||
ReturnBuffer = (UINT8 *) Buffer;
|
||||
|
||||
|
||||
while (Length-- != 0) {
|
||||
MmioWrite8 (StartAddress++, *(Buffer++));
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 16-bit access.
|
||||
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 16-bit access. The total number
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 16-bit access. The total number
|
||||
of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 16-bit boundary, then ASSERT().
|
||||
@@ -283,7 +283,7 @@ MmioWriteBuffer16 (
|
||||
UINT16 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
@@ -291,10 +291,10 @@ MmioWriteBuffer16 (
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT16 *) Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite16 (StartAddress, *(Buffer++));
|
||||
|
||||
|
||||
StartAddress += sizeof (UINT16);
|
||||
Length -= sizeof (UINT16);
|
||||
}
|
||||
@@ -306,13 +306,13 @@ MmioWriteBuffer16 (
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 32-bit access.
|
||||
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 32-bit access. The total number
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 32-bit access. The total number
|
||||
of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 32-bit boundary, then ASSERT().
|
||||
@@ -337,7 +337,7 @@ MmioWriteBuffer32 (
|
||||
UINT32 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
@@ -345,10 +345,10 @@ MmioWriteBuffer32 (
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT32 *) Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite32 (StartAddress, *(Buffer++));
|
||||
|
||||
|
||||
StartAddress += sizeof (UINT32);
|
||||
Length -= sizeof (UINT32);
|
||||
}
|
||||
@@ -359,13 +359,13 @@ MmioWriteBuffer32 (
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 64-bit access.
|
||||
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 64-bit access. The total number
|
||||
Copy data from system memory specified by Buffer to the MMIO region specified
|
||||
by starting address StartAddress by using 64-bit access. The total number
|
||||
of byte to be copied is specified by Length. Buffer is returned.
|
||||
|
||||
|
||||
If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
|
||||
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
|
||||
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
|
||||
|
||||
If Length is not aligned on a 64-bit boundary, then ASSERT().
|
||||
@@ -390,7 +390,7 @@ MmioWriteBuffer64 (
|
||||
UINT64 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
|
||||
@@ -398,10 +398,10 @@ MmioWriteBuffer64 (
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT64 *) Buffer;
|
||||
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite64 (StartAddress, *(Buffer++));
|
||||
|
||||
|
||||
StartAddress += sizeof (UINT64);
|
||||
Length -= sizeof (UINT64);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
We don't advocate putting compiler specifics in libraries or drivers but there
|
||||
is no other way to make this work.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -146,7 +146,7 @@ IoRead16 (
|
||||
|
||||
If 16-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
@@ -176,7 +176,7 @@ IoWrite16 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to read.
|
||||
|
||||
@return The value read.
|
||||
@@ -206,7 +206,7 @@ IoRead32 (
|
||||
|
||||
If 32-bit I/O port operations are not supported, then ASSERT().
|
||||
If Port is not aligned on a 32-bit boundary, then ASSERT().
|
||||
|
||||
|
||||
@param Port The I/O port to write.
|
||||
@param Value The value to write to the I/O port.
|
||||
|
||||
|
Reference in New Issue
Block a user