public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* /arch/ppc64/kernel/setup.c
@ 2002-04-05 15:29 Thomas 'Dent' Mirlacher
  2002-04-09 14:28 ` /arch/ppc64/kernel/setup.c Peter Bergner
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas 'Dent' Mirlacher @ 2002-04-05 15:29 UTC (permalink / raw)
  To: linux-kernel

hi list,

can someone please explain to me who calibrate_delay works in
arch/ppc64/kernel/setup.c?

as i can see it calibrate.c is a global function defined in init/main.h.
arch/ppc64/kernel/setup.c sets a pointer to the address of this function
extern void (*calibrate_delay)(void); and assigns its own routine to that
pointer. - hmm, every time i tried to do similar things (by mistake :),
the program segfaulted on me.

- can someone please explain how this should work?

thanks,

	tm

-- 
in some way i do, and in some way i don't.


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

* Re: /arch/ppc64/kernel/setup.c
  2002-04-05 15:29 /arch/ppc64/kernel/setup.c Thomas 'Dent' Mirlacher
@ 2002-04-09 14:28 ` Peter Bergner
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Bergner @ 2002-04-09 14:28 UTC (permalink / raw)
  To: Thomas 'Dent' Mirlacher; +Cc: linux-kernel

Thomas 'Dent' Mirlacher wrote:
: can someone please explain to me who calibrate_delay works in
: arch/ppc64/kernel/setup.c?
: 
: as i can see it calibrate.c is a global function defined in init/main.h.
: arch/ppc64/kernel/setup.c sets a pointer to the address of this function
: extern void (*calibrate_delay)(void); and assigns its own routine to that
: pointer. - hmm, every time i tried to do similar things (by mistake :),
: the program segfaulted on me.
: 
: - can someone please explain how this should work?

What's you're not seeing is the additional patch to the "offical"
sources which is required to get a working ppc64 kernel.  It's not
in the offical sources due to it touching non-arch specific files.
I've included the relevent part of the patch you're not seeing below.  
You can find the full patch at www.penguinppc64.org.

Peter



diff -uNr --exclude=CVS /kernels/64/linux-2.4.18-rc3/init/main.c linuxppc64_2_4/init/main.c
--- /kernels/64/linux-2.4.18-rc3/init/main.c	Thu Feb 21 17:04:28 2002
+++ linuxppc64_2_4/init/main.c	Thu Feb 21 21:02:01 2002
@@ -129,7 +129,6 @@
 char *execute_command;
 char root_device_name[64];
 
-
 static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
 static char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
 
@@ -336,7 +335,7 @@
    better than 1% */
 #define LPS_PREC 8
 
-void __init calibrate_delay(void)
+void __init do_calibrate_delay(void)
 {
 	unsigned long ticks, loopbit;
 	int lps_precision = LPS_PREC;
@@ -376,6 +375,8 @@
 		loops_per_jiffy/(500000/HZ),
 		(loops_per_jiffy/(5000/HZ)) % 100);
 }
+
+void (*calibrate_delay)(void) = do_calibrate_delay;
 
 static int __init readonly(char *str)
 {

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

end of thread, other threads:[~2002-04-09 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-05 15:29 /arch/ppc64/kernel/setup.c Thomas 'Dent' Mirlacher
2002-04-09 14:28 ` /arch/ppc64/kernel/setup.c Peter Bergner

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