Skip to content

Instantly share code, notes, and snippets.

@mgalgs
Last active August 27, 2020 09:49
Show Gist options
  • Save mgalgs/5557198 to your computer and use it in GitHub Desktop.
Save mgalgs/5557198 to your computer and use it in GitHub Desktop.
#define __define_initcall(level,fn,id) \
static initcall_t __initcall_##fn##id __used \
__attribute__((__section__(".initcall" level ".init"))) = fn
#define core_initcall(fn) __define_initcall("1",fn,1)
#define subsys_initcall(fn) __define_initcall("4",fn,4)
#define late_initcall(fn) __define_initcall("7",fn,7)
/* trimmed, obviously... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment