Jens Nerche <[EMAIL PROTECTED]> wrote:

> I'm unhapping with hand over data via context.event_info in such way.
> Perhaps has anybody a better idea.

Well, I'd prefer to avoid increasing the size of the user_context
or else copying additional elements between kernel and user mode,
for simple efficiency reasons.

We still aren't completely exhausting all possibilities; the event_info
has still a little room, and there's also the ioctl return value that
could be used ...

To improve readability, however, I'd suggest to introduce macros to
pack/unpack the various arguments info event_info values.


Just some further comments:

> -int emulate_in(void);
> -int emulate_out(void);
> +int emulate_in_imm8(guest_context_t *,int);
> +int emulate_in_dx(guest_context_t *,int);
> +int emulate_out_imm8(guest_context_t *,int);
> +int emulate_out_dx(guest_context_t *,int);

Why split this up?  The DX register can be read while decoding
just as well; this would simplify the kernel/user interface a bit.
I'd suggest 'emulate_[in|out](context, port, op_size)' or so.

Furthermore, I think you should advance the eip while you're at it, 
so that execution restarts at the next instruction when user restarts 
the ioctl after successful emulation ...


> -    if (!create_proc_info_entry("freemware", 0, NULL, fmw_read_procmem))
> +    if (!create_proc_info_entry("freemware", 0, NULL, (void *)fmw_read_procmem))

Oops.  Is there a argument type mismatch?  Don't hide it, fix it ;-)


Bye,
Ulrich

Reply via email to