lkcd
[Top] [All Lists]

Re: Alpha port: lcrash/current.h

To: Brian Hall <brianw.hall@xxxxxxxxxx>
Subject: Re: Alpha port: lcrash/current.h
From: Tom Morano <tjm@xxxxxxx>
Date: Fri, 17 Mar 2000 14:05:43 -0800
Cc: lkcd@xxxxxxxxxxx, "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>, tjm@xxxxxxx
References: <XFMail.20000317142938.brianw.hall@compaq.com>
Sender: owner-lkcd@xxxxxxxxxxx
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.

This isn't "wrong" from an lcrash point of view. lcrash is only including kernel
header files to gain access to kernel type declarations. Since it is not
actually
a part of the kernel, it doesn't really need much of the rest of the stuff 
that gets declared. I wish there was some clean way to declare kernel types in 
lcrash without having to deal with all the rest of the junk in the kernel 
header 
files. I would prefer that no kernel header files get modified (except when
needed by the kernel portion of LKCD)...but that may not be possible in the
alpha 
case. If it gets us through the build without warnings, then it's a good thing.

Tom

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