To: | |
---|---|
Subject: | [ts-7000] Re: TS-7KV PLD Registers - simple code seg faults - ne suggestions |
From: | "Matt Godbolt" <> |
Date: | Wed, 23 Aug 2006 15:18:30 -0000 |
--- In "mattsaintdev" <> wrote: > > Hi all, > > Spotted the rewrite of the Getting Started with the TS-7KV manual and > must say its much clearer now - thanks. > > Wrote the following test program to learn how to read the PLD regs, > but the only output is the first two printf lines. As soon as the > code accesses the PLD_REGS i get a segfault. > > Ne suggestions? > > Matt > My guess is the call to mmap() is failing and thus retuning MAP_FAILED (-1), which you then dereference later on. mmap() is possibly failing as you're passing a length of '0xff' and not a multiple of a single page (getpagesize()). It's always worth checking for failure and then checking errno - you've probably got an EINVAL: EINVAL We don't like start or length or offset. (E.g., they are too large, or not aligned on a page boundary.) Cheers, Matt (another one!) Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ts-7000/ <*> To unsubscribe from this group, send an email to: <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] TS-7KV PLD Registers - simple code seg faults - ne suggestions, mattsaintdev |
---|---|
Next by Date: | Re: [ts-7000] Re: Problems with TS7260 and PRISMQ WUA-11G, Eddie Dawydiuk |
Previous by Thread: | [ts-7000] TS-7KV PLD Registers - simple code seg faults - ne suggestions, mattsaintdev |
Next by Thread: | Re: [ts-7000] TS-7KV PLD Registers - simple code seg faults - ne suggestions, Don W. Carr |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU