lkcd
[Top] [All Lists]

RE: Alpha port: lcrash/current.h

To: lkcd@xxxxxxxxxxx
Subject: RE: Alpha port: lcrash/current.h
From: Brian Hall <brianw.hall@xxxxxxxxxx>
Date: Fri, 17 Mar 2000 15:03:35 -0700 (MST)
Cc: "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>
In-reply-to: <XFMail.20000317142938.brianw.hall@compaq.com>
Reply-to: Brian Hall <brianw.hall@xxxxxxxxxx>
Sender: owner-lkcd@xxxxxxxxxxx
Actually, it works better if the #define/#undef of __LCRASH__ is done in
cmd/lcrash/lib/libklib/asm/kl_kernel.h, instead of in lcrash.h:

--------------------kl_kernel.h---------------------
#include <linux/autoconf.h>
#ifdef CONFIG_SMP
#ifndef __SMP__
#define __SMP__
#endif
#endif

#define __LCRASH__
#include <linux/mm.h>
#undef  __LCRASH__

/* #include <asm/fixmap.h> */ 

/* We have to do some stuff to get rid of some warning messages that
 * resulted from us using both standard and kernel header files (yuch!).
 */
#ifdef __NFDBITS
#undef __NFDBITS
#endif
#ifdef __FDMASK
#undef __FDMASK
#endif

#define off_t off_t

#include <stdio.h>
---------------------------------------------------------


On 17-Mar-2000 Brian Hall wrote:
> Porting lkcd to Alpha...
> 
> After much fustration, I defined __LCRASH__ in lcrash.h, and modified
> current.h
> to remove the "warning: call-clobbered register used for global register
> variable" problem as follows:
> 
> ------------------current.h------------------------
>#ifndef _ALPHA_CURRENT_H
>#define _ALPHA_CURRENT_H
> 
>#ifndef __LCRASH__
> register struct task_struct *current __asm__("$8");
>#else
> struct task_struct *current;
>#endif
> 
>#endif /* !(_ALPHA_CURRENT_H) */
> ---------------------------------------------------
> 
> This allowed compilation to proceed, but seems dangerous- will lcrash need to
> access the current register during its processing? If this is wrong, what is
> the correct way to fix this? Trying to #ifndef header sections out (in the
> main Linux include tree) based on __LCRASH__ wasn't very productive.

-- 
http://www.bigfoot.com/~brihall
Linux Consultant

<Prev in Thread] Current Thread [Next in Thread>