Skip to contentSkip to conversation

help about trap_setup..

DISCUSSION Bob 3 participants 5 messages Dec 11, 2008 – Dec 13, 2008

lore
Share & tools
lore

Bob

author
#0 lore raw

In trap path "trap_setup", if in trap window we will jmp to "trap_setup_kernel_spill".

/* See if we are in the trap window. */

  93        andcc   %t_twinmask, %t_wim, %g0
  94        bne     trap_setup_kernel_spill         ! in trap window, clean up
  95         nop
  96
  97        /* Trap from kernel with a window available.
  98         * Just do it...
  99         */
 100        jmpl    %t_retpc + 0x8, %g0     ! return to caller
 101         mov    %t_kstack, %sp          ! jump onto new stack
 102
 103trap_setup_kernel_spill:
 104        ld      [%curptr + TI_UWINMASK], %g1
 105        orcc    %g0, %g1, %g0
 106        bne     trap_setup_user_spill   ! there are some user windows, yuck

But where is the %curptr in line 104 is setted?

the comment said #define curptr g6 /* Set after pt_regs frame is built */

but i can't find the code set %g6 in these scene.

what'more, what are "user windows" like the line 106 said meaning. There need a lot of particular dealing,

I am still reading it.

Thanks!

---
Best regards

Bob Liu
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

author
#1 lore raw

Still no answer...

Quoted 28 lines

From: [email protected]
To: [email protected]
Subject: help about trap_setup..
Date: Thu, 11 Dec 2008 11:17:54 +0800

In trap path "trap_setup", if in trap window we will jmp to "trap_setup_kernel_spill".

/* See if we are in the trap window. */
93 andcc %t_twinmask, %t_wim, %g0
94 bne trap_setup_kernel_spill ! in trap window, clean up 95 nop
96
97 /* Trap from kernel with a window available.
98 * Just do it...
99 */
100 jmpl %t_retpc + 0x8, %g0 ! return to caller
101 mov %t_kstack, %sp ! jump onto new stack
102
103trap_setup_kernel_spill:
104 ld [%curptr + TI_UWINMASK], %g1
105 orcc %g0, %g1, %g0
106 bne trap_setup_user_spill ! there are some user windows, yuck

But where is the %curptr in line 104 is setted?

the comment said #define curptr g6 /* Set after pt_regs frame is built */

Quoted 8 lines

but i can't find the code set %g6 in these scene.

what'more, what are "user windows" like the line 106 said meaning. There need a lot of particular dealing,

I am still reading it.

Thanks!

_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

#2 lore raw
In reply to Bob
Quoted 2 lines · Bob

Still no answer...

From the outside it looks like you are reading the assembler and when you encounter somthing you do not understand you trigger a mail and then stop looking at it.

I looked myself at the curptr and could not see where gr6 is assigned, but if I really wanted to know then I would grab another cup of coffee and look closer.
And when I found out myself I would know more for next time, and I would reply with the answer.
Just sitting and waitng is not the way forward with this stuff.

So I encourage you to stir at the code for some more hours. and maybe try to patch it and see if it changes behaviour.

And when you find out please send a patch adding a comment so the next person does not have to spend 20 hours to understand it.

Good luck,

Sam

#3 lore raw
In reply to Bob

From: Bob <[email protected]>
Date: Fri, 12 Dec 2008 17:02:36 +0800

Quoted 2 lines

Still no answer...

Nobody is obligated to answer your questions. And that really means nobody.

And I personally am in the mountains trying to enjoy some time off. So it is very unpleasant for me to see something like this! :-/

I've had enough and personally I'm not going to anwer any of your sparc questions.

Sorry.

author
#4 lore raw
In reply to Bob

I am so sorry for that.And I found the answer by myself after reading the code

more and more.

Thanks for Sam's suggestion. I am blush for my lazy.

But i am not intentionally,davem ! I will try my best to corrct my mistakes. Such things

won't happen again.

Sorry again for that! Hoping you guys forgive me...
_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE