[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 18:17:18 +0800 |
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;
--
Bean