AHCI: Replace MMIO accesses with helper functions
authorFergus Simpson <afergs@google.com>
Mon, 17 Oct 2016 22:08:51 +0000 (15:08 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 18 Oct 2016 20:02:14 +0000 (16:02 -0400)
commit26f49c2678749302e45adbea88d55775d6401d84
tree4979d852b2127b0c3a7f9a0e03644527cf0b8430
parentd99646f33edd092d073903cfe9b702aadff65f73
AHCI: Replace MMIO accesses with helper functions

This commit removes all pointer accesses to MMIO by removing the
structs that represented MMIO. They have been replaced by helper
functions that use volatile accesses to make sure that the reads
and writes always happen. Instead of structs, blocks of memory are
simply used that are indexed into using constants that represent each
register. All virtual addresses are represented by void pointers, and
all physical addresses would be represented by uintptr_t types; however,
all physical addresses are stored in MMIO and hence are only accessed
with the provided helper functions. They are only written to as
addresses needed by the HBA. The host keeps its own references to the
structs as void pointers to virtual memory.

Change-Id: Ia62cd57797ca8db9f21f47559c524149ad6fc11e
Signed-off-by: Fergus Simpson <afergs@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/x86.h
kern/drivers/dev/sdiahci.c
kern/include/ahci.h