[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnumach FP Struct (Beating a dead horse)

From: Samuel Thibault
Subject: Re: Gnumach FP Struct (Beating a dead horse)
Date: Thu, 21 Dec 2006 09:55:57 +0100
User-agent: Mutt/1.5.11

Barry deFreese, le Thu 21 Dec 2006 00:17:34 -0500, a écrit :
> I apologize for keep going on about this but I still don't quite 
> understand why a seperate struct is needed for i386_fp_regs.

I told you: this permits to easily do what is written in fpu.c:

             * Ensure that reserved parts of the environment are 0.
            memset(user_fp_state,  0, sizeof(struct i386_fp_save));

            user_fp_state->fp_control = ifps->fp_save_state.fp_control;
            user_fp_state->fp_status  = ifps->fp_save_state.fp_status;
            user_fp_state->fp_tag     = ifps->fp_save_state.fp_tag;
            user_fp_state->fp_eip     = ifps->fp_save_state.fp_eip;
            user_fp_state->fp_cs      = ifps->fp_save_state.fp_cs;
            user_fp_state->fp_opcode  = ifps->fp_save_state.fp_opcode;
            user_fp_state->fp_dp      = ifps->fp_save_state.fp_dp;
            user_fp_state->fp_ds      = ifps->fp_save_state.fp_ds;
            *user_fp_regs = ifps->fp_regs;

With separate structs, the last line can be written that way, allowing
the compiler to optimize the copy. For getting the same result without
separate structs, we'd have to call an ugly explicit memcpy().


reply via email to

[Prev in Thread] Current Thread [Next in Thread]