* [U-Boot-Users] Access global data from standalone application
@ 2005-06-17 22:31 Shawn Jin
2005-06-17 23:06 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Shawn Jin @ 2005-06-17 22:31 UTC (permalink / raw)
To: u-boot
Hi,
Is there any way to access global data defined in U-Boot from
standalone applications? For example, hello_world wants to access
flash_info[].
Regards,
-Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] Access global data from standalone application
2005-06-17 22:31 [U-Boot-Users] Access global data from standalone application Shawn Jin
@ 2005-06-17 23:06 ` Wolfgang Denk
2005-06-18 0:45 ` Shawn Jin
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2005-06-17 23:06 UTC (permalink / raw)
To: u-boot
In message <c3d0340b05061715317273d9ae@mail.gmail.com> you wrote:
>
> Is there any way to access global data defined in U-Boot from
> standalone applications? For example, hello_world wants to access
> flash_info[].
Be careful with your terms. It is trivial to access "global data" in
SA apps as the GD pointer is passed in a register - but "Global Data"
in U-Boot is something which has nothing to do with flash_info[].
You can export and call in SA apps functions which perform operations
on flash_info[], but you cannot access flash_info[] or any other
global variables directly.
Note that this is intentional.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
G's Third Law: In spite of all evidence to the contra-
ry, the entire universe is composed of only two basic substances:
magic and bullshit.
H's Dictum: There is no magic ...
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] Access global data from standalone application
2005-06-17 23:06 ` Wolfgang Denk
@ 2005-06-18 0:45 ` Shawn Jin
2005-06-18 15:18 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Shawn Jin @ 2005-06-18 0:45 UTC (permalink / raw)
To: u-boot
> > Is there any way to access global data defined in U-Boot from
> > standalone applications? For example, hello_world wants to access
> > flash_info[].
>
> Be careful with your terms. It is trivial to access "global data" in
> SA apps as the GD pointer is passed in a register - but "Global Data"
> in U-Boot is something which has nothing to do with flash_info[].
Well, what I meant is exported data. Thanks for the clarification. My
understanding is that the GD pointer points to gd_t. Those data inside
gd_t can be accessed trivially in SA apps, as you said.
> You can export and call in SA apps functions which perform operations
> on flash_info[], but you cannot access flash_info[] or any other
> global variables directly.
Confused. How do SA apps perform operations on exported data without
accessing them? Could you elaborate a little bit? I want to write a SA
app to print the protection info of all flash banks. I know flinfo can
do that. I just do some experiments. ;)
Regards,
-Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] Access global data from standalone application
2005-06-18 0:45 ` Shawn Jin
@ 2005-06-18 15:18 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2005-06-18 15:18 UTC (permalink / raw)
To: u-boot
Hello,
in message <c3d0340b05061717456bc12331@mail.gmail.com> you wrote:
>
> > You can export and call in SA apps functions which perform operations
^^^^^^ ^^^^ ^^^^^^^^^
> > on flash_info[], but you cannot access flash_info[] or any other
> > global variables directly.
>
> Confused. How do SA apps perform operations on exported data without
> accessing them? Could you elaborate a little bit? I want to write a SA
By calling functions in the U-Boot code which use the data.
> app to print the protection info of all flash banks. I know flinfo can
> do that. I just do some experiments. ;)
Then just export and call the do_flinfo function.
Why reinvent the wheel or duplicate already existing code?
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
-- Isaac Asimov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-06-18 15:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-17 22:31 [U-Boot-Users] Access global data from standalone application Shawn Jin
2005-06-17 23:06 ` Wolfgang Denk
2005-06-18 0:45 ` Shawn Jin
2005-06-18 15:18 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.