This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Send function segment buf address is invalid]


On Tue, Aug 02, 2005 at 10:34:36PM -0700, mkhoyila@uci.edu wrote:
> Let me clarify, ingore my previous values. I made mistake on values
> supplied. A sample run values are as follows:
> 
> sg_list->buf address is at: 0x80079956 (assigned to from_p)
> sg_list->len is 42 (decimal)
> txBufds address is at: 0x9f838 (this is a physical address, assigned to to_p)
> 
> This line "memcpy((unsigned char *)to_p, from_p, l);" is failing and does
> not proceed to next instruction.

So you are using memcpy to copy from a virtual address to a physical
address. Have you setup the MMU to allow this? Are you sure there is
something at that physical address. Is there a plain one to one
mapping between virtual addresses and physical addresses since memcpy
has no concept of physical addresses. In fact, why are you using a
physical address? You normally use those for DMA engines, not code.
 
> I used kmalloc to acquire memory space for rx and tx dma buffers. Any help
> is appreciated. Thanks.

kmalloc? There is no kmallloc in the driver API! It is normal to
either statically allocate the buffers or if you need the memory in
specific areas, eg a PCI window, you implement your own memory
management functions for the PCI window.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]