From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 9 Apr 2002 10:28:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 9 Apr 2002 10:28:11 -0400 Received: from brule.borg.umn.edu ([160.94.232.10]:29460 "EHLO brule.borg.umn.edu") by vger.kernel.org with ESMTP id ; Tue, 9 Apr 2002 10:28:10 -0400 From: Peter Bergner Date: Tue, 9 Apr 2002 09:28:03 -0500 To: "Thomas 'Dent' Mirlacher" Cc: linux-kernel@vger.kernel.org Subject: Re: /arch/ppc64/kernel/setup.c Message-ID: <20020409092803.A416306@brule.borg.umn.edu> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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) {