OsdMemory.c (6a068746777241722b2b32c5d0bc443a2a64d80b) | OsdMemory.c (7ae99f80b6661760c5de3edd330b279f04b092a2) |
---|---|
1/*- 2 * Copyright (c) 2000 Mitsaru Iwasaki 3 * Copyright (c) 2000 Michael Smith 4 * Copyright (c) 2000 BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 49 unchanged lines hidden (view full) --- 58AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length) 59{ 60 return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length)); 61} 62 63void 64AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Length) 65{ | 1/*- 2 * Copyright (c) 2000 Mitsaru Iwasaki 3 * Copyright (c) 2000 Michael Smith 4 * Copyright (c) 2000 BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 49 unchanged lines hidden (view full) --- 58AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length) 59{ 60 return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length)); 61} 62 63void 64AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Length) 65{ |
66 pmap_unmapbios((vm_offset_t)LogicalAddress, Length); | 66 pmap_unmapbios(LogicalAddress, Length); |
67} 68 69ACPI_STATUS 70AcpiOsGetPhysicalAddress(void *LogicalAddress, 71 ACPI_PHYSICAL_ADDRESS *PhysicalAddress) 72{ 73 /* We can't necessarily do this, so cop out. */ 74 return (AE_BAD_ADDRESS); --- 30 unchanged lines hidden (view full) --- 105 case 32: 106 *Value = *(volatile uint32_t *)LogicalAddress; 107 break; 108 case 64: 109 *Value = *(volatile uint64_t *)LogicalAddress; 110 break; 111 } 112 | 67} 68 69ACPI_STATUS 70AcpiOsGetPhysicalAddress(void *LogicalAddress, 71 ACPI_PHYSICAL_ADDRESS *PhysicalAddress) 72{ 73 /* We can't necessarily do this, so cop out. */ 74 return (AE_BAD_ADDRESS); --- 30 unchanged lines hidden (view full) --- 105 case 32: 106 *Value = *(volatile uint32_t *)LogicalAddress; 107 break; 108 case 64: 109 *Value = *(volatile uint64_t *)LogicalAddress; 110 break; 111 } 112 |
113 pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8); | 113 pmap_unmapdev(LogicalAddress, Width / 8); |
114 115 return (AE_OK); 116} 117 118ACPI_STATUS 119AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address, UINT64 Value, UINT32 Width) 120{ 121 void *LogicalAddress; --- 12 unchanged lines hidden (view full) --- 134 case 32: 135 *(volatile uint32_t *)LogicalAddress = Value; 136 break; 137 case 64: 138 *(volatile uint64_t *)LogicalAddress = Value; 139 break; 140 } 141 | 114 115 return (AE_OK); 116} 117 118ACPI_STATUS 119AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address, UINT64 Value, UINT32 Width) 120{ 121 void *LogicalAddress; --- 12 unchanged lines hidden (view full) --- 134 case 32: 135 *(volatile uint32_t *)LogicalAddress = Value; 136 break; 137 case 64: 138 *(volatile uint64_t *)LogicalAddress = Value; 139 break; 140 } 141 |
142 pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8); | 142 pmap_unmapdev(LogicalAddress, Width / 8); |
143 144 return (AE_OK); 145} | 143 144 return (AE_OK); 145} |