Skip to content

Instantly share code, notes, and snippets.

@lawl
Created June 2, 2017 12:05
Show Gist options
  • Save lawl/8ae7660304f6b9a453aae115de712d9e to your computer and use it in GitHub Desktop.
Save lawl/8ae7660304f6b9a453aae115de712d9e to your computer and use it in GitHub Desktop.
/*for hardrebooting from pmos into [bootloader|recovery]*/
#include <sys/syscall.h>
#include <linux/reboot.h>
int main(int argc, char **argv) {
syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
LINUX_REBOOT_CMD_RESTART2, argv[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment