Re: Oops in fault.c, Unable to handle kernel paging request at virtual address 00000004



On Fri, 23 Nov 2007 11:46:20 -0800 (PST), mattng604@xxxxxxxxx wrote:

Hi,

I am trying to typecast a void* pointer to a structure I defined

It is never necessary to cast a void* to another pointer to object
type. Your problem lies elsewhere.

called _sfrdm336_mdb. However, when I try, I get the following error:

You have a struct tag named _sfrdm336_mdb but your struct type is
either sFRDM336_MDB or struct _sfrdm336_mdb, never plain
_sfrdm336_mdb.

Oops in fault.c, Unable to handle kernel paging request at virtual
address 00000004 .

It would be nice if you told us whether this was a compile time, link
time, or run time message.


Could you please help me? I'm very stuck! I even tried ioremap() to
map the physical address kmalloc returns to a virtual address. The
problem occurs when I try to do the typecast (sFRDM336_MDB *) below:

No it doesn't.


/
******************************************************************************/
typedef struct _sfrdm336_mdb
{
INT4 errModule; /* Global error Indicator for
module
calls */
UINT2 valid; /* Indicates that this structure
has been
initialized */
eFRDM336_MOD_STATE stateModule; /* Module state; can be one of
the following
FRDM336_MOD_START,
FRDM336_MOD_IDLE or
FRDM336_MOD_READY */
UINT2 maxDevs; /* Maximum number of devices
supported */
UINT2 numDevs; /* Number of devices currently
registered */
UINT2 maxInitProfs; /* Maximum number of
initialization
profiles */
sFRDM336_DDB *pddb; /* (array of) Device Data Blocks
(DDB) in
context memory */
sFRDM336_DIV *pinitProfs; /* (array of) Initialization
profiles in
context memory */
} sFRDM336_MDB;


sFRDM336_MDB *frdm336Mdb; // TOP OF FILE, public variable

INT4 frdm336ModuleOpen ()
{

frdm336Mdb = (sFRDM336_MDB *) kmalloc(sizeof(sFRDM336_MDB),
GFP_KERNEL);

Since kmalloc is not a standard function, you will probably get much
better advice in a newsgroup devoted to whatever system it is provided
with.


sysFrdm336MemSet(frdm336Mdb, 0, size);

return 0;

} /* frdm336ModuleOpen */
/
******************************************************************************/


Thanks in advance for your help!
Matt


Remove del for email
.



Relevant Pages

  • Re: invalid pointer adress
    ... >> pointer causes the program to exit with a core dump. ... struct s2{void *p;}; ... int leseExterneHinweise_masch_storno ... typedef struct s_AusdatFeldbeschreibung ...
    (comp.lang.c)
  • Re: A C Adventure: your comments are welcome
    ... void * usrRightSegment; ... That is a string is a binary tree of segments, ... struct inside a struct either as the thing itself or as a pointer ... because C makes it easy to change pointer type. ...
    (comp.lang.c)
  • Re: Some issue with pointers
    ... typedef struct { ... void *ptr; ... and a pointer to the items structure. ...
    (comp.lang.c)
  • Re: function pointer casting
    ... Here you say the second member of the struct is a function pointer ... apparently is not the same as pointer to void. ... implied assignment of the argument to the parameter. ...
    (comp.lang.c)
  • Re: Another spinoza challenge
    ... You should test against the int type's limits: ... typedef struct complex ... a pointer to an integer ... A macro is preferable because it is replaced by inline code, ...
    (comp.lang.c)