[SeaBIOS] [PATCH 3/3] Misc conversions to GET/SET_LOWFLAT().

Kevin O'Connor kevin at koconnor.net
Sat May 26 03:52:04 CEST 2012


Convert from GET/SET_FLATPTR() to GET/SET_LOWFLAT() - the latter
produces better code.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/ata.c |    4 ++--
 src/usb.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ata.c b/src/ata.c
index b261bfe..3246acb 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -408,14 +408,14 @@ ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
         if (count > max)
             count = max;
 
-        SET_FLATPTR(dma->buf_fl, dest);
+        SET_LOWFLAT(dma->buf_fl, dest);
         bytes -= count;
         if (!bytes)
             // Last descriptor.
             count |= 1<<31;
         dprintf(16, "dma@%p: %08x %08x\n", dma, dest, count);
         dest += count;
-        SET_FLATPTR(dma->count, count);
+        SET_LOWFLAT(dma->count, count);
         dma++;
     }
 
diff --git a/src/usb.c b/src/usb.c
index aaa2c8e..1391f0e 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -59,7 +59,7 @@ send_control(struct usb_pipe *pipe, int dir, const void *cmd, int cmdsize
 int
 usb_send_bulk(struct usb_pipe *pipe_fl, int dir, void *data, int datasize)
 {
-    switch (GET_FLATPTR(pipe_fl->type)) {
+    switch (GET_LOWFLAT(pipe_fl->type)) {
     default:
     case USB_TYPE_UHCI:
         return uhci_send_bulk(pipe_fl, dir, data, datasize);
@@ -73,7 +73,7 @@ usb_send_bulk(struct usb_pipe *pipe_fl, int dir, void *data, int datasize)
 int noinline
 usb_poll_intr(struct usb_pipe *pipe_fl, void *data)
 {
-    switch (GET_FLATPTR(pipe_fl->type)) {
+    switch (GET_LOWFLAT(pipe_fl->type)) {
     default:
     case USB_TYPE_UHCI:
         return uhci_poll_intr(pipe_fl, data);
-- 
1.7.6.5




More information about the SeaBIOS mailing list