Shutdown (embedded) linux from kernel-space
I'm working on a modified version of the 2.6.35 kernel for Olinuxino, an
ARM9 based platform. I'm trying to modify the power management driver (the
architecture specific part).
The processor is a Freescale i.MX23. This processor has a "special" pin,
called PSWITCH, that triggers an interrupt that is handled by the power
management driver. If the switch is pressed,the system goes to standby.
This is done in the driver by calling pm_suspend(PM_SUSPEND_STANDBY).
Given my hardware setup, I'd like to, instead, shutdown the system. So my
question is:
What is the preferred way for a kernel-space process to trigger a clean
system halt/poweroff?
I suppose there's a nice little function call out there, but I couldn't
find it so far.
My kernel code (the file I'm working on is arch/arm/mach-mx23/pm.c) can be
found here: github.com/spairal/linux-for-lobster, though my question calls
for a general Linux kernel approach.
No comments:
Post a Comment