Changeset 77662 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCacheMaintenanceLib
- Timestamp:
- Mar 12, 2019 12:40:12 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129295
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776 /vendor/edk2/current 103735-103757,103769-103776,129194-129237
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
r58466 r77662 5 5 # This library assumes there are no chipset dependencies required to maintain caches. 6 6 # 7 # Copyright (c) 2007 - 201 4, Intel Corporation. All rights reserved.<BR>7 # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR> 8 8 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 9 9 # … … 24 24 FILE_GUID = 123dd843-57c9-4158-8418-ce68b3944ce7 25 25 MODULE_TYPE = BASE 26 VERSION_STRING = 1. 026 VERSION_STRING = 1.1 27 27 LIBRARY_CLASS = CacheMaintenanceLib 28 28 -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.uni
r58464 r77662 1 // /** @file1 // /** @file 2 2 // Instance of Cache Maintenance Library using Base Library services. 3 3 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c
r58466 r77662 2 2 Cache Maintenance Functions. 3 3 4 Copyright (c) 2006 - 20 08, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 17 17 #include <Library/BaseLib.h> 18 18 #include <Library/DebugLib.h> 19 20 //21 // This size must be at or below the smallest cache size possible among all22 // supported processors23 //24 #define CACHE_LINE_SIZE 0x2025 19 26 20 /** … … 129 123 ) 130 124 { 125 UINT32 RegEbx; 126 UINT32 RegEdx; 127 UINTN CacheLineSize; 131 128 UINTN Start; 132 129 UINTN End; … … 138 135 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Address)); 139 136 137 // 138 // If the CPU does not support CLFLUSH instruction, 139 // then promote flush range to flush entire cache. 140 // 141 AsmCpuid (0x01, NULL, &RegEbx, NULL, &RegEdx); 142 if ((RegEdx & BIT19) == 0) { 143 AsmWbinvd (); 144 return Address; 145 } 146 147 // 148 // Cache line size is 8 * Bits 15-08 of EBX returned from CPUID 01H 149 // 150 CacheLineSize = (RegEbx & 0xff00) >> 5; 151 140 152 Start = (UINTN)Address; 141 153 // 142 154 // Calculate the cache line alignment 143 155 // 144 End = (Start + Length + (C ACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE- 1);145 Start &= ~((UINTN) CACHE_LINE_SIZE- 1);156 End = (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1); 157 Start &= ~((UINTN)CacheLineSize - 1); 146 158 147 159 do { 148 Start = (UINTN)AsmFlushCacheLine ((VOID*)Start) + C ACHE_LINE_SIZE;160 Start = (UINTN)AsmFlushCacheLine ((VOID*)Start) + CacheLineSize; 149 161 } while (Start != End); 150 162 return Address;
Note:
See TracChangeset
for help on using the changeset viewer.