Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-04-2014, 08:40 PM   #1
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 75

Rep: Reputation: Disabled
u-boot os function pointer array initialization

Hi all,

I am looking at cmd_bootm.c of the u-boot code. Can someone explain to me the following syntax?
boot_os_fn is a function pointer after typedef.
I know it's trying to initialize an array of function pointer, but I don't understand this index in particular:

"[IH_OS_LINUX] = do_bootm_linux"

static boot_os_fn *boot_os[] = {
[IH_OS_LINUX] = do_bootm_linux,
[IH_OS_NETBSD] = do_bootm_netbsd,
[IH_OS_LYNXOS] = do_bootm_lynxkdi,
[IH_OS_RTEMS] = do_bootm_rtems,
#if defined(CONFIG_CMD_ELF)
[IH_OS_VXWORKS] = do_bootm_vxworks,
[IH_OS_QNX] = do_bootm_qnxelf,
[IH_OS_INTEGRITY] = do_bootm_integrity,



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can i pass an entire Array into a function parameter by value? (no pointer pass) esgol Programming 26 07-31-2012 12:34 PM
Bash array Add function example using indirect array reference as function argument bobywelsh Programming 10 07-05-2010 05:44 AM
in C, how do I pass a pointer of an array of structures to a function? randomsel Programming 2 02-04-2008 07:23 PM
I just want to make sure this is correct, struct pointer array paramter in function. RHLinuxGUY Programming 6 08-20-2006 10:30 PM
sending pointer array to function marek Programming 4 04-15-2004 05:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration