[uClinux-dev] nios2: how to update broken references to "sg->page"?
Robert P. J. Day
rpjday at crashcourse.ca
Sat Oct 27 01:59:24 EDT 2007
ok, i'm definitely going to need some guidance on this one. having
resolved several build errors for nios2 under the absolutely latest
kernel tree, i'm now looking at this one:
CC arch/nios2nommu/mm/dma-noncoherent.o
arch/nios2nommu/mm/dma-noncoherent.c: In function `dma_map_sg':
arch/nios2nommu/mm/dma-noncoherent.c:139: error: structure has no member named `page'
arch/nios2nommu/mm/dma-noncoherent.c:142: error: structure has no member named `page'
... snip more of the same ...
well, that's not surprising, since the 2.6.23+ "struct scatterlist"
definition no longer has a "page" member, but looks more like this
(this is what i've replaced it with, it might or might not be totally
correct):
==============================================
#ifndef __ASM_NIOS2_SCATTERLIST_H
#define __ASM_NIOS2_SCATTERLIST_H
struct scatterlist {
#ifdef CONFIG_DEBUG_SG
unsigned long sg_magic;
#endif
unsigned long page_link; <-- used to be "page"
unsigned int offset;
dma_addr_t dma_address;
unsigned int length;
};
#define ISA_DMA_THRESHOLD (0xffffffff)
#define sg_dma_address(sg) (virt_to_bus((sg)->dma_address))
#define sg_dma_len(sg) ((sg)->length)
#endif /* __ASM_NIOS2_SCATTERLIST_H */
============================================
and about that new "page_link" member, well, the header file
include/linux/scatterlist.h explains it thusly:
/*
* Notes on SG table design.
*
* Architectures must provide an unsigned long page_link field in the
* scatterlist struct. We use that to place the page pointer AND encode
* information about the sg table as well. The two lower bits are reserved
* for this information.
*
* If bit 0 is set, then the page_link contains a pointer to the next sg
* table list. Otherwise the next entry is at sg + 1.
*
* If bit 1 is set, then this sg entry is the last element in a list.
*
* See sg_next().
*
*/
long story short, i have to figure out how to update the
nios2-specific source file arch/nios2nommu/mm/dma-noncoherent.c to
use the new scatterlist struct. i'm going to start reading up on
this, but if someone has a quick fix to that file, i'm all ears.
rday
p.s. not surprisingly, that redefinition of the scatterlist structure
might affect other architectures as well if they've hard-coded
references to "sg->page" anywhere.
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://crashcourse.ca
========================================================================
More information about the uClinux-dev
mailing list