Hi Thomas,
Thomas Chou wrote:
Change the page member of the scatterlist structure to be an unsigned
long, and encode more stuff in the lower bits:
- Bits 0 and 1 zero: this is a normal sg entry. Next sg entry is located
at sg + 1.
- Bit 0 set: this is a chain entry, the next real entry is at
->page_link
with the two low bits masked off.
- Bit 1 set: this is the final entry in the sg entry. sg_next() will
return
NULL when passed such an entry.
It's thus important that sg table users use the proper accessors to get
and set the page member.
Originated-by: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Thomas Chou <[EMAIL PROTECTED]>
Applied, thanks.
Regards
Greg
---
linux-2.6.x/include/asm-nios2nommu/scatterlist.h | 26 ++++++++++++++++------
1 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/linux-2.6.x/include/asm-nios2nommu/scatterlist.h
b/linux-2.6.x/include/asm-nios2nommu/scatterlist.h
index 20898e2..5064ea1 100644
--- a/linux-2.6.x/include/asm-nios2nommu/scatterlist.h
+++ b/linux-2.6.x/include/asm-nios2nommu/scatterlist.h
@@ -1,13 +1,25 @@
-#ifndef __ASM_SH_SCATTERLIST_H
-#define __ASM_SH_SCATTERLIST_H
+#ifndef __ASM_SCATTERLIST_H
+#define __ASM_SCATTERLIST_H
+
+#include <asm/types.h>
struct scatterlist {
- struct page * page; /* Location for highmem page, if any */
- unsigned int offset;/* for highmem, page offset */
- dma_addr_t dma_address;
- unsigned int length;
+ unsigned long page_link;
+ unsigned int offset;
+ dma_addr_t dma_address;
+ unsigned int length;
};
+/*
+ * These macros should be used after a pci_map_sg call has been done
+ * to get bus addresses of each of the SG entries and their lengths.
+ * You should only work with the number of sg entries pci_map_sg
+ * returns, or alternatively stop on the first sg_dma_len(sg) which
+ * is 0.
+ */
+#define sg_dma_address(sg) ((sg)->dma_address)
+#define sg_dma_len(sg) ((sg)->length)
+
#define ISA_DMA_THRESHOLD (0xffffffff)
-#endif /* !(__ASM_SH_SCATTERLIST_H) */
+#endif /* __ASM_SCATTERLIST_H */
--
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED]
Secure Computing Corporation PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev