LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-04-2014, 08:40 PM   #1
david_8274
Member
 
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[] = {
#ifdef CONFIG_BOOTM_LINUX
[IH_OS_LINUX] = do_bootm_linux,
#endif
#ifdef CONFIG_BOOTM_NETBSD
[IH_OS_NETBSD] = do_bootm_netbsd,
#endif
#ifdef CONFIG_LYNXKDI
[IH_OS_LYNXOS] = do_bootm_lynxkdi,
#endif
#ifdef CONFIG_BOOTM_RTEMS
[IH_OS_RTEMS] = do_bootm_rtems,
#endif
#if defined(CONFIG_CMD_ELF)
[IH_OS_VXWORKS] = do_bootm_vxworks,
[IH_OS_QNX] = do_bootm_qnxelf,
#endif
#ifdef CONFIG_INTEGRITY
[IH_OS_INTEGRITY] = do_bootm_integrity,
#endif
};


Thanks,
DX
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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