ahci: complete hbafis_t struct
This commit is contained in:
parent
54ccb27ef0
commit
adfa24dd1e
2 changed files with 50 additions and 0 deletions
|
|
@ -161,6 +161,24 @@ struct fis_pio_setup {
|
|||
uint16_t reserved5;
|
||||
} PACKED;
|
||||
|
||||
struct fis_set_device_bits {
|
||||
/* 0x00 */
|
||||
uint8_t fis_type;
|
||||
|
||||
uint8_t pmult : 4;
|
||||
uint8_t reserved : 2;
|
||||
uint8_t interrupt : 1;
|
||||
uint8_t n : 1;
|
||||
|
||||
uint8_t statusl : 3;
|
||||
uint8_t reserved2 : 1;
|
||||
uint8_t statush : 3;
|
||||
uint8_t reserved3 : 1;
|
||||
|
||||
/* 0x04 */
|
||||
uint8_t errorl : 3;
|
||||
} PACKED;
|
||||
|
||||
typedef volatile struct {
|
||||
/* 0x00 */
|
||||
uint32_t clb;
|
||||
|
|
@ -221,6 +239,30 @@ typedef volatile struct {
|
|||
hbaport_t ports[32];
|
||||
} PACKED hbamem_t;
|
||||
|
||||
typedef volatile struct {
|
||||
/* 0x00 */
|
||||
struct fis_dma_setup dfis;
|
||||
uint32_t reserved;
|
||||
|
||||
/* 0x20 */
|
||||
struct fis_pio_setup pfis;
|
||||
uint32_t reserved1[3];
|
||||
|
||||
/* 0x40 */
|
||||
struct fis_reg_d2h rfis;
|
||||
uint32_t reserved2;
|
||||
|
||||
struct fis_set_device_bits sdbfis;
|
||||
|
||||
/* 0x60 */
|
||||
uint8_t ufis[64];
|
||||
|
||||
|
||||
/* 0xA0 */
|
||||
uint8_t reserved3[0x60];
|
||||
|
||||
} PACKED hbafis_t;
|
||||
|
||||
void ahci_init();
|
||||
|
||||
#endif /* _AHCI_H_ */
|
||||
|
|
|
|||
|
|
@ -402,12 +402,20 @@ void mem_early_init(char *mem, size_t len)
|
|||
alloc_page = kmap_alloc_page;
|
||||
pml4 = NULL;
|
||||
|
||||
/* map the kernel */
|
||||
struct mem_region lastregion = mem_regions[num_regions - 1];
|
||||
kmap(kpaddr, kvaddr, kernel_size, attrs.val);
|
||||
|
||||
/* identity map the entire physical address space */
|
||||
attrs.pcd = 1;
|
||||
kmap(0, hhdm_start, lastregion.base + lastregion.len, attrs.val);
|
||||
|
||||
/* remap usable regions with pcd=0 */
|
||||
attrs.pcd = 0;
|
||||
for (unsigned int i = 0; i < num_regions; i++) {
|
||||
kmap(regions[i].base, regions[i].base | hhdm_start, regions[i].len, attrs.val);
|
||||
}
|
||||
|
||||
pml4_paddr = (uintptr_t)pml4;
|
||||
pml4_paddr &= (~hhdm_start);
|
||||
cr3.pml4_addr = pml4_paddr >> 12;
|
||||
|
|
|
|||
Loading…
Reference in a new issue