[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grub2 resets machine when reading from an xfs filesystem
From: |
Bean |
Subject: |
Re: grub2 resets machine when reading from an xfs filesystem |
Date: |
Wed, 30 Jan 2008 20:36:58 +0800 |
On Jan 30, 2008 8:08 PM, Marco Gerards <address@hidden> wrote:
>
> Bean <address@hidden> writes:
>
> > I figure it out, the problem is caused by nested function:
> >
> > int call_hook (grub_uint64_t ino, char *filename)
> >
> > it would take 3 registry to pass the parameter ! (2 for ino), so %ecx
> > will be overwritten agian.
> >
> > NESTED_FUNC_ATTR doesn't help, because there is only 2 parameters
> > here, so you need to use __attribute__ ((regparm (1))) explicitly.
> >
> > diff --git a/fs/xfs.c b/fs/xfs.c
> > index b3154c7..0e5f323 100644
> > --- a/fs/xfs.c
> > +++ b/fs/xfs.c
> > @@ -306,9 +306,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
> > grub_fshelp_node_t node))
> > {
> > struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
> > - auto int call_hook (grub_uint64_t ino, char *filename);
> > + auto int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino,
> > char *filename);
> >
> > - int call_hook (grub_uint64_t ino, char *filename)
> > + int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino, char
> > *filename)
> > {
> > struct grub_fshelp_node *fdiro;
>
> Do you have a more generic solution to this? Something that can be
> compared with NESTED_FUNC_ATTR? This is an i386 only bug...
perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1))) ?
> Besides that, XFS is still not finished as BTrees are not yet
> supported. So big files/directories cannot be accessed yet :-/
i'll check this out later.
--
Bean