Linux MIPS Architecture development
 help / color / mirror / Atom feed
* argument mismatch in prom_init() for DDB5074?
@ 2000-06-28  2:39 Jun Sun
  2000-06-28  7:35 ` Harald Koerfgen
  2000-06-28  7:44 ` Gleb O. Raiko
  0 siblings, 2 replies; 3+ messages in thread
From: Jun Sun @ 2000-06-28  2:39 UTC (permalink / raw)
  To: linux, linux-mips


I compiled an image for DDB5074.  I got a TLB fault immediately after
the control enters prom_init() function.  A further probe shows that the
caller are passing differents arguments to prom_init than what the
callee expected.  See code excerpt below.

Does this mean the code of DDB5074 is outdated?  In any case, can
someone give me a hint on how to fix this?  It does not look obvious at
the first sight...

=============
arch/mips/kernel/setup.c:
init_arch(...)
{
	unsigned int s;

	/* Determine which MIPS variant we are running on. */
	cpu_probe();

	prom_init(argc, argv, envp, prom_vec);

...
}

===========
arch/mips/ddb5074/prom.c:
void __init prom_init(const char *s)
{
    int i = 0;
    unsigned long mem_size, free_start, free_end, start_pfn,
bootmap_size;

//  _serinit();

    if (s != (void *)-1)
	while (*s && i < sizeof(arcs_cmdline)-1)
	    arcs_cmdline[i++] = *s++;
    arcs_cmdline[i] = '\0';
...

Jun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: argument mismatch in prom_init() for DDB5074?
  2000-06-28  2:39 argument mismatch in prom_init() for DDB5074? Jun Sun
@ 2000-06-28  7:35 ` Harald Koerfgen
  2000-06-28  7:44 ` Gleb O. Raiko
  1 sibling, 0 replies; 3+ messages in thread
From: Harald Koerfgen @ 2000-06-28  7:35 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips, linux


On 28-Jun-00 Jun Sun wrote:
> 
> I compiled an image for DDB5074.  I got a TLB fault immediately after
> the control enters prom_init() function.  A further probe shows that the
> caller are passing differents arguments to prom_init than what the
> callee expected.  See code excerpt below.
> 
> Does this mean the code of DDB5074 is outdated?  In any case, can
> someone give me a hint on how to fix this?  It does not look obvious at
> the first sight...

That's probably ok. The different bootloaders on different platforms loaders pass
different arguments to the kernel.

harry@localhost:~> cd linux/arch/mips
harry@localhost:~/linux/arch/mips > grep prom_init\( `find . -name '*.c'`
./arc/init.c:int __init prom_init(int argc, char **argv, char **envp,
int*prom_vec)
./baget/prom/init.c:int __init prom_init(unsigned int mem_upper)
./ddb5074/prom.c:void __init prom_init(const char *s)
./dec/prom/init.c:int __init prom_init(int argc, char **argv,
./kernel/setup.c:extern int prom_init(int, char **, char **, int *);
./kernel/setup.c:       prom_init(argc, argv, envp, prom_vec);                   
                       
The call in setup.c just has to make shure that all possible arguments are passed
to the platform specific prom_init(). How they are interpreted is up to
prom_init().

-- 
Regards,
Harald

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: argument mismatch in prom_init() for DDB5074?
  2000-06-28  2:39 argument mismatch in prom_init() for DDB5074? Jun Sun
  2000-06-28  7:35 ` Harald Koerfgen
@ 2000-06-28  7:44 ` Gleb O. Raiko
  1 sibling, 0 replies; 3+ messages in thread
From: Gleb O. Raiko @ 2000-06-28  7:44 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux, linux-mips



Jun Sun wrote:
> 
> I compiled an image for DDB5074.  I got a TLB fault immediately after
> the control enters prom_init() function.  A further probe shows that the
> caller are passing differents arguments to prom_init than what the
> callee expected.  See code excerpt below.

Most of the ports have the same mismatch. Usually, bios/prom/bootloader
calls the box independend routine, kernel_netry (head.S) with some
arguments. kernel_enry prepares C environment and calls init_arch w/ the
same arguments. The number of the arguments and their types are box
dependent. kernel_entry and init_arch never try to access the arguments
to be passed by prom, but just pass the arguments to prom_init.
Moreover, the arguments declared in init_arch don't match any mips box,
they are mix of calling conventions of ARC console and DECstation prom
(the last one).

Fortunately, sizeof(int) == sizeof(long) == sizeof(pointer) in mips32,
so we may happy live with that.

> 
> Does this mean the code of DDB5074 is outdated?  In any case, can
> someone give me a hint on how to fix this?  It does not look obvious at
> the first sight...
> 

I think, you shouldn't fix the argument list, continue bug searching in
other places.

Regards,
Gleb.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-06-28  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-28  2:39 argument mismatch in prom_init() for DDB5074? Jun Sun
2000-06-28  7:35 ` Harald Koerfgen
2000-06-28  7:44 ` Gleb O. Raiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox