Index: uspace/drv/block/ahci/ahci.c
===================================================================
--- uspace/drv/block/ahci/ahci.c	(revision acdb5bacffa0840fa18ced3443b7bcb244837b8d)
+++ uspace/drv/block/ahci/ahci.c	(revision 8442d1010feb8698f9e91ca9405377165dcfd6eb)
@@ -119,6 +119,6 @@
 static int ahci_identify_device(sata_dev_t *);
 static int ahci_set_highest_ultra_dma_mode(sata_dev_t *);
-static int ahci_rb_fpdma(sata_dev_t *, void *, uint64_t);
-static int ahci_wb_fpdma(sata_dev_t *, void *, uint64_t);
+static int ahci_rb_fpdma(sata_dev_t *, uintptr_t, uint64_t);
+static int ahci_wb_fpdma(sata_dev_t *, uintptr_t, uint64_t);
 
 static void ahci_sata_devices_create(ahci_dev_t *, ddf_dev_t *);
@@ -233,8 +233,8 @@
 	sata_dev_t *sata = fun_sata_dev(fun);
 	
-	void *phys;
+	uintptr_t phys;
 	void *ibuf;
-	int rc = dmamem_map_anonymous(sata->block_size, AS_AREA_READ | AS_AREA_WRITE,
-	    0, &phys, (void **) &ibuf);
+	int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
+	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
 	if (rc != EOK) {
 		ddf_msg(LVL_ERROR, "Cannot allocate read buffer.");
@@ -276,8 +276,8 @@
 	sata_dev_t *sata = fun_sata_dev(fun);
 	
-	void *phys;
+	uintptr_t phys;
 	void *ibuf;
-	int rc = dmamem_map_anonymous(sata->block_size, AS_AREA_READ | AS_AREA_WRITE,
-	    0, &phys, (void **) &ibuf);
+	int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
+	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
 	if (rc != EOK) {
 		ddf_msg(LVL_ERROR, "Cannot allocate write buffer.");
@@ -336,5 +336,5 @@
  *
  */
-static void ahci_identify_device_cmd(sata_dev_t *sata, void *phys)
+static void ahci_identify_device_cmd(sata_dev_t *sata, uintptr_t phys)
 {
 	volatile sata_std_command_frame_t *cmd =
@@ -381,5 +381,5 @@
  *
  */
-static void ahci_identify_packet_device_cmd(sata_dev_t *sata, void *phys)
+static void ahci_identify_packet_device_cmd(sata_dev_t *sata, uintptr_t phys)
 {
 	volatile sata_std_command_frame_t *cmd =
@@ -435,8 +435,9 @@
 	}
 	
-	void *phys;
+	uintptr_t phys;
 	sata_identify_data_t *idata;
 	int rc = dmamem_map_anonymous(SATA_IDENTIFY_DEVICE_BUFFER_LENGTH,
-	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, (void **) &idata);
+	    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
+	    (void **) &idata);
 	if (rc != EOK) {
 		ddf_msg(LVL_ERROR, "Cannot allocate buffer to identify device.");
@@ -561,5 +562,5 @@
  *
  */
-static void ahci_set_mode_cmd(sata_dev_t *sata, void* phys, uint8_t mode)
+static void ahci_set_mode_cmd(sata_dev_t *sata, uintptr_t phys, uint8_t mode)
 {
 	volatile sata_std_command_frame_t *cmd =
@@ -567,5 +568,5 @@
 	
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
-	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR; 
+	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
 	cmd->command = 0xef;
 	cmd->features = 0x03;
@@ -628,8 +629,9 @@
 	}
 	
-	void *phys;
+	uintptr_t phys;
 	sata_identify_data_t *idata;
 	int rc = dmamem_map_anonymous(SATA_SET_FEATURE_BUFFER_LENGTH,
-	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, (void **) &idata);
+	    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
+	    (void **) &idata);
 	if (rc != EOK) {
 		ddf_msg(LVL_ERROR, "Cannot allocate buffer for device set mode.");
@@ -677,5 +679,6 @@
  *
  */
-static void ahci_rb_fpdma_cmd(sata_dev_t *sata, void *phys, uint64_t blocknum)
+static void ahci_rb_fpdma_cmd(sata_dev_t *sata, uintptr_t phys,
+    uint64_t blocknum)
 {
 	volatile sata_ncq_command_frame_t *cmd =
@@ -734,5 +737,5 @@
  *
  */
-static int ahci_rb_fpdma(sata_dev_t *sata, void *phys, uint64_t blocknum)
+static int ahci_rb_fpdma(sata_dev_t *sata, uintptr_t phys, uint64_t blocknum)
 {
 	if (sata->is_invalid_device) {
@@ -763,5 +766,6 @@
  *
  */
-static void ahci_wb_fpdma_cmd(sata_dev_t *sata, void *phys, uint64_t blocknum)
+static void ahci_wb_fpdma_cmd(sata_dev_t *sata, uintptr_t phys,
+    uint64_t blocknum)
 {
 	volatile sata_ncq_command_frame_t *cmd =
@@ -821,5 +825,5 @@
  *
  */
-static int ahci_wb_fpdma(sata_dev_t *sata, void *phys, uint64_t blocknum)
+static int ahci_wb_fpdma(sata_dev_t *sata, uintptr_t phys, uint64_t blocknum)
 {
 	if (sata->is_invalid_device) {
@@ -933,5 +937,5 @@
 {
 	size_t size = 4096;
-	void *phys = NULL;
+	uintptr_t phys = 0;
 	void *virt_fb = NULL;
 	void *virt_cmd = NULL;
@@ -949,6 +953,6 @@
 	
 	/* Allocate and init retfis structure. */
-	int rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
-	    &phys, &virt_fb);
+	int rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
+	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_fb);
 	if (rc != EOK)
 		goto error_retfis;
@@ -959,6 +963,6 @@
 	
 	/* Allocate and init command header structure. */
-	rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
-	    &phys, &virt_cmd);
+	rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
+	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_cmd);
 	if (rc != EOK)
 		goto error_cmd;
@@ -970,6 +974,6 @@
 	
 	/* Allocate and init command table structure. */
-	rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
-	    &phys, &virt_table);
+	rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
+	    AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_table);
 	if (rc != EOK)
 		goto error_table;
@@ -1153,5 +1157,5 @@
 	ahci->memregs = NULL;
 	
-	physmem_map((void *) (size_t) (hw_res_parsed.mem_ranges.ranges[0].address),
+	physmem_map((uintptr_t) (hw_res_parsed.mem_ranges.ranges[0].address),
 	    AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE,
 	    (void **) &ahci->memregs);
