On Thu, Dec 17, 2009 at 04:24:22PM -0700, Jerry Jelinek wrote:
> Edward Pilatowicz wrote:
> >to be:
> >---8<---
> >/*
> > * The saved stack pointer (V_SSP) points to the interrupt specific
> > * state, which is saved directly above the stack contents common to all
> > * callbacks.
> >...
> >*/
> >#define V_U_SS          (V_END + (CLONGSIZE * 4))
> >#define V_U_ESP         (V_END + (CLONGSIZE * 3))
> >#define V_EFLAGS        (V_END + (CLONGSIZE * 2))
> >#define V_U_CS          (V_END + (CLONGSIZE * 1))
> >#define V_U_EIP         (V_END + (CLONGSIZE * 0))
> >
> >ENTRY(sn1_brand_int91_callback)
> >...
> >     SET_V(%rsp, 1, V_U_EIP, %r15)   /* set user %eip to JMP table addr */
> >     GET_V(%rsp, 1, V_URET_ADDR, %rax) /* save orig return addr in %eax */
> >---8<---
>
> Ed,
>
> Thanks for the correction on the comment.  I also updated the code as
> you suggested.  I'm not sure if what I have now is better than before
> but its the same number of instructions and its more similar to the
> the 32-bit code path (although it can't be identical).  I posted a new
> webrev at:
>
> http://cr.opensolaris.org/~gjelinek/webrev.6768950/
>
> Let me know if you have any other comments.


so now you have:
---8<---
#define V_U_EIP         (CLONGSIZE * 0)
...
        GET_V(%rsp, 1, V_SSP, %rax)     /* get saved stack pointer */
        SET_V(%rax, 0, V_U_EIP, %r15)   /* save new return addr in %eip */
---8<---

but why can't this be identical to the 32-bit path?  afaik, it seems
like you could just do:

---8<---
#define V_U_EIP         (V_END + (CLONGSIZE * 0))
...
        SET_V(%rsp, 1, V_U_EIP, %r15)   /* save new return addr in %eip */
---8<---

why load V_SSP if we already know that the interrupt state is right on
the stack above the callback arguments?  (it seems we sholud just
access the state directly without first loading V_SSP.)

ed
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to