Stack Frame Calc Problem in head_4xx.S

Jerry Walden jwalden at digitalatlantic.com
Sun May 4 07:20:51 EST 2003


Greetings:

I am having trouble understanding what is happening to my stack pointer.

At line 1 r1 = 0x03f9_ebe8

After line 15 executes r1 = 0xc00f4ff0
which seems fine so far (according to the map file it is pointing to the
proper location)

After line 16 executes r1=0xc00f6ff0
which is still within the bounds of init_task_union

After line 17 execute r1 = 0xc00f6fe0 which seems like a problem to me,
because it is not with the
bounds of init_task_union - (see map file below)

I would expect r1 to be within the bounds of init_task_union after this code
is executed -
is my guess correct?  If so how is it possible that line 17 comes up with
the result
that it did?

TASK_UNION_SIZE = 8192
STACK_FRAME_OVERHEAD = 16

Thanks for any help

Jerry

1 start_here:
2
3	/* ptr to current */
4	lis	r2,init_task_union at h
5	ori	r2,r2,init_task_union at l
6
7	/* ptr to phys current thread */
8	tophys(r4,r2)
9	addi	r4,r4,THREAD	/* init task's THREAD */
10	mtspr	SPRG3,r4
11	li	r3,0
12	mtspr	SPRG2,r3	/* 0 => r1 has kernel sp */
13
14	/* stack */
15	addi	r1,r2,TASK_UNION_SIZE
16	li	r0,0
17	stwu	r0,-STACK_FRAME_OVERHEAD(r1)


c00f4ff0 D init_task_union
c00f6ff0 d aligninfo
c00f70f0 D cpuinfo_op
c00f7100 D cpu_specs
c00f7280 D ppc_htab_operations



Jerry Walden
Program Manager
Digital Atlantic Inc
http://www.digitalatlantic.com
jwalden at digitalatlantic.com
1-877-494-6073 x407
cell - 703-431-2413


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/




More information about the Linuxppc-embedded mailing list