Re: [U-Boot] [PATCH] Save/restore global data pointer on API boundary

2012-08-08 Thread Leif Lindholm
On 08/07/12 19:30, Wolfgang Denk wrote: Most architectures keep the global data pointer (gd) in a register. This may, or may not be. You should not make any assumptions on how gd is implemented. The comment did, the code didn't, as long as gd was a pointer (which should be a safe assumption)

Re: [U-Boot] [PATCH] Save/restore global data pointer on API boundary

2012-08-07 Thread Wolfgang Denk
Dear Leif Lindholm, In message <50214a38.3000...@arm.com> you wrote: > Most architectures keep the global data pointer (gd) in a register. This may, or may not be. You should not make any assumptions on how gd is implemented. > When using the external app API, because they are calling us rather

[U-Boot] [PATCH] Save/restore global data pointer on API boundary

2012-08-07 Thread Leif Lindholm
Most architectures keep the global data pointer (gd) in a register. When using the external app API, because they are calling us rather than we calling them, this register can be corrupted. The attached (trivial) patch saves the gd pointer at api_init(), and restores it on every entry to syscall(