[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allocating memory with alloc_bootmem_pages



Hi,

I'm trying to allocate memory in the init function of one of my drivers.
Here's the line of code from the init function : 

	g_pucFpgaBitmapMem = (unsigned char*)  alloc_bootmem_pages (PAGE_SIZE);

I always get a crash when this command will be executed. Here's the output
from sermon : 

<snip>

Unable to handle kernel NULL pointer dereference at virtual address
00000000
Oops: 0000
IRP: c00eb85a SRP: c00ebbf8 DCCR: 000004a4 USP: 00802a12 MOF: 00000000
 r0: 40000000  r1: 00000000   r2: 40000000  r3: 00000000
 r4: 00000001  r5: 00000000   r6: c00f8210  r7: 00000000
 r8: 00000800  r9: 00000001  r10: 00000001 r11: 00002000
r12: 00000000 r13: 00000000 oR10: 00000001
R_MMU_CAUSE: 00001000
Process swapper (pid: 1, stackpage=c0264000)

Stack from 00802a12:
       Failing address 0x802a12

Call Trace: Failing address 0x802a12

Stack from c0265e3c:
       c0008398 c0265f74 c0059d72 c0059ed6 00002000 00000000 00000000
00000000 
       c0265f30 c0002000 c0265f30 c0059f80 c0008398 c005d132 00000800
00000000 
       c00f8210 00000000 00000001 00000000 c0265f30 c0002000 00000000
00000000 
Call Trace: [<c0008398>] [<c0059d72>] [<c0059ed6>] [<c0059f80>]
[<c0008398>] [<c005d132>] [<c000d22c>] 
       [<c000a708>] [<c000a62e>] [<c000a3e4>] [<c005aa00>] [<c005cf2c>]
[<c0059b8a>] [<c0008398>] [<c0004086>] 
       [<c0059cdc>] 
Code: 6a 96 ed 94 24 e1 6d da 6d c5 29 9b (3c) 20 24 16 a4 16 61 b6 01 b2
61 06 
Kernel panic: Attempted to kill init!

<snip>

Doing the same with ioremap in unallocated DRAM memory space works but I
would like to use the bootmem method instead of ioremapping the DRAM.

Is there any problem with the CRIS implementation and alloc_bootmem_pages
? 

I'm using Linux 2.4.19 on an Etrax MCM 8+2.
 
Thank you in advance,

	Arne Bockholdt

Dipl. Inform. Arne Bockholdt
REA Elektronik GmbH
Teichwiesenstr. 1
64367 Mühltal-Waschenbach
Tel. +49 (0) 6154 / 638-115, Fax -195
ABockholdt@xxxxxxx.de