Compare commits

..

No commits in common. "238659e94b52a47212109dcfc3d46f10c0494994" and "2935903baedf29ea87f50e49f2583fcc304b1740" have entirely different histories.

2 changed files with 2 additions and 35 deletions

View File

@ -4,7 +4,6 @@ import hulk.cpu;
import hulk.klog;
import hulk.hurl;
import hulk.hurl.a1;
import hulk.range;
struct Pci
{
@ -36,7 +35,6 @@ struct Pci
ubyte if_id;
bool multifunction;
ubyte header_type;
Range[6] memory_ranges;
void initialize(Address address, ushort vendor_id, ushort device_id)
{
@ -63,7 +61,6 @@ struct Pci
private void map_memory_regions()
{
size_t range_index;
uint[2] r;
uint[2] s;
for (uint reg_no = 4u; reg_no <= 9u; reg_no++)
@ -112,13 +109,10 @@ struct Pci
{
s[1] = 0xFFFF_FFFFu;
}
ulong mm_region_address = (cast(ulong)r[0] & 0xFFFF_FFF0u) | (cast(ulong)r[1] << 32u);
ulong addr = (cast(ulong)r[0] & 0xFFFF_FFF0u) | (cast(ulong)r[1] << 32u);
ulong length = ~((cast(ulong)s[0] & 0xFFFF_FFF0u) | (cast(ulong)s[1] << 32u)) + 1u;
ulong flags = (r[0] & 0x8) != 0u ? PT_WRITE_THROUGH : 0u;
Hurl.identity_map_range(mm_region_address, length, flags);
memory_ranges[range_index].address = mm_region_address;
memory_ranges[range_index].length = length;
range_index++;
Hurl.identity_map_range(addr, length, flags);
if (is_64bit)
{
reg_no++;

View File

@ -1,27 +0,0 @@
module hulk.range;
/**
* Representation of a memory range.
*/
struct Range
{
/** Range base address. */
void * _address;
/** Range length. */
size_t length;
/** Set the range address. */
@property void * address(T)(T a)
{
static assert(T.sizeof == size_t.sizeof);
_address = cast(void *)a;
return _address;
}
/** Get the range address. */
@property void * address()
{
return _address;
}
}