LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   u-boot os function pointer array initialization (https://www.linuxquestions.org/questions/linux-newbie-8/u-boot-os-function-pointer-array-initialization-4175497050/)

david_8274 03-04-2014 07:40 PM

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


All times are GMT -5. The time now is 03:58 AM.