Re: return-type for search_extable()

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Mon Jan 27 2003 - 23:53:20 EST


In message <15921.33955.645830.709868@napali.hpl.hp.com> you write:
> Hi Rusty,
>
> Could you please change the return-type of search_extable() to
> something that allows a bit more flexibility? The value returned by
> this function is "something that lets architecture-specific code
> recover from a memory-managment-fault". This may or may not be the
> same as an exception_table_entry. For example, on ia64, I want to
> return an already-relocated fixup-word. Perhaps the cleanest way to
> fix this would be to have:
>
> exception_fixup_t search_extable (...);
>
> By default, you could then use
>
> typedef struct exception_table_entry *exception_fixup_t;
>
> and on ia64 I could use:
>
> typedef long exception_fixup_t.

Sure. Of course, you could just cast the return value to a long
inside ia64, but that's pretty unclear.

Hmm, I actually just tried to do this, and like all typedefs, it's
icky. search_exception_table() belongs in kernel.h, not module.h
where it is now. But that means kernel.h has to include asm/uaccess.h
to get exception_fixup_t.

Maybe the cleanest way really is to simply document that your
search_extable() returns the fixup word... 8(

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 31 2003 - 22:00:18 EST