Change reboot signature.
Change from `void reboot(void)` to `int reboot(int mode)`. Move reboot definition to core, rename architecture implementations from reboot to reboot_arch. Declare reboot mode(s) in kernel.h, reboot_arch in kernel_internal.h Currently only one reboot mode is handled, its use is enforced. Rationale: A reboot function is already defined in <unistd.h> on BSD systems. (See: http://www.openbsd.org/cgi-bin/man.cgi?query=reboot&sektion=2) This patch not only allows native to build sensibly on these systems but also streamlines RIOTs compatability with existing software.dev/timer
parent
0c9fd83693
commit
063a15ce9b
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Ludwig Ortmann
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser General
|
||||
* Public License. See the file LICENSE in the top level directory for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup core_util
|
||||
* @{
|
||||
*
|
||||
* @file reboot.c
|
||||
* @brief Reboot function
|
||||
*
|
||||
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "kernel.h"
|
||||
#include "kernel_internal.h"
|
||||
|
||||
int reboot(int mode)
|
||||
{
|
||||
if (mode != RB_AUTOBOOT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return reboot_arch(mode);
|
||||
}
|
Loading…
Reference in New Issue