stack pointer used in vector_swi() in arm linux system call

2018-10-02 Thread Anonymous Page
Hi, While reading the vector_swi() routine for arm linux system call, I found that r0-r12 registers are copied to the kernel stack(below is the code). ENTRY(vector_swi) #ifdef CONFIG_CPU_V7M v7m_exception_entry #else sub sp, sp, #S_FRAME_SIZE stmia sp, {r0 - r12}

Re: stack pointer

2016-03-07 Thread Valdis . Kletnieks
On Mon, 07 Mar 2016 13:07:14 +0530, Nitin Varyani said: > Where is the stack pointer for the current process stored in linux? In the stack pointer register, of course. (And if the code was compiled with -fomit-stack-pointer there isn't even one. :) The fun and games starts when you talk ab

stack pointer

2016-03-06 Thread Nitin Varyani
ess? Where is the stack pointer for the current process stored in linux? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Fabio Pozzi
Why function arguments are stored from offset 12 of SP? Also notice values at offset 0 to 10 are always same, and value at offset 11 increases by 20 on each invocation of function foo(). You have to consider that local variables are allocated on the stack, thus both i, stackptr and sp are

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Manavendra Nath Manav
On Wed, Dec 12, 2012 at 3:56 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote: Why function arguments are stored from offset 12 of SP? Also notice values at offset 0 to 10 are always same, and value at offset 11 increases by 20 on each invocation of function foo(). You have to consider that local

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Manavendra Nath Manav
On Wed, Dec 12, 2012 at 4:02 PM, Manavendra Nath Manav mnm.ker...@gmail.com wrote: On Wed, Dec 12, 2012 at 3:56 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote: Why function arguments are stored from offset 12 of SP? Also notice values at offset 0 to 10 are always same, and value at offset 11

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Fabio Pozzi
When i call print values at offsets starting from __builtin_frame_address (0) the function arguments start from offset 2. How can I confirm that this behavior is always consistent. Arguments are pushed on the stack before the saved frame pointer, thus you have to add an offset equal to the

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Manavendra Nath Manav
On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote: When i call print values at offsets starting from __builtin_frame_address (0) the function arguments start from offset 2. How can I confirm that this behavior is always consistent. Arguments are pushed on the stack

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Matthias Brugger
On 12/12/2012 12:24 PM, Manavendra Nath Manav wrote: On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote: When i call print values at offsets starting from __builtin_frame_address (0) the function arguments start from offset 2. How can I confirm that this behavior is

Re: Find out function arguments value from stack pointer

2012-12-12 Thread 卜弋天
在 2012-12-12,19:28,Manavendra Nath Manav mnm.ker...@gmail.com 写道: On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote: When i call print values at offsets starting from __builtin_frame_address (0) the function arguments start from offset 2. How can I confirm that this

Re: how does linux restores a thread's stack pointer, program counter and return address.

2011-10-04 Thread Dave Hylands
Hi Smital, On Mon, Oct 3, 2011 at 9:20 PM, Smital Desai smital.de...@lntinfotech.com wrote: Hi. I am using linux 2.6.39 and MIPS core. I am keen to find out how does linux restores a thread's stack pointer, program counter and return address. I have created a binary which spawns four