Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SAM9263 Shutdown in user mode
PostPosted: Fri Jan 16, 2009 11:00 pm 
Offline

Joined: Fri Jan 16, 2009 10:46 pm
Posts: 44
Hi to everybody,
I need to put the SAM9263 in shutdown mode from an user application.

I have implemented the shutdown is implemented as a KernelIoControl.
The source code used to invoked the function call in my subproject is as following:
if (!KernelIoControl(IOCTL_HAL_SHUTDOWN, NULL, 0, NULL, 0, NULL))
wsprintf (szDbg, TEXT ("Failed to IOCTL_HAL_SHUTDOWN.\r\n"));
else
wsprintf (szDbg, TEXT ("Succeed in IOCTL_HAL_SHUTDOWN.\r\n"));

but the system call doesn’t work.

I have checked the file /public/common/oak/oalicotl/oalioctl.cpp and the system call
for the shutdown IOCTL_HAL_SHUTDOWN seems not be specified:

switch (dwIoControlCode) {
case IOCTL_HAL_GET_CACHE_INFO:
case IOCTL_HAL_GET_DEVICE_INFO:
case IOCTL_HAL_GET_DEVICEID:
case IOCTL_HAL_GET_UUID:
case IOCTL_PROCESSOR_INFORMATION:
// request is to service the ioctl - forward the call to OAL code

// OAL code will set the last error if there is a failure

fRet = (*g_pfnExtOALIoctl)(dwIoControlCode, pInBuf, nInBufSize, pOutBuf, nOutBufSize, pBytesReturned);

break;

default:

SetLastError(ERROR_NOT_SUPPORTED);

break;

...and the KernelIOControl fails because IOCTL_HAL_SHUTDOWN is not supported.

somebody has already faced this problem?

many thanks in advance
bob


Top
 Profile  
 
 Post subject: Re: SAM9263 Shutdown in user mode
PostPosted: Mon Jan 19, 2009 9:53 am 
Offline

Joined: Fri May 14, 2004 9:58 am
Posts: 183
Location: France - USA
Hi,

You cannot use a KernelIoControl directly from an user application because your application doesn't have the access right.

You'll need to clone oemioctl.dll, modify it to add your desired ioctls, and
use that one in your image. oemioctl.dll is the gatekeeper that determines
which kernel ioctls are allowed to be called from user mode.

Regards,
Adeneo Support Team


Top
 Profile  
 
 Post subject: Re: SAM9263 Shutdown in user mode
PostPosted: Mon Jan 19, 2009 4:55 pm 
Offline

Joined: Fri Jan 16, 2009 10:46 pm
Posts: 44
Thanks a lot for your reply.
Sorry if I boring you but I have just another question about this issue:
if I create a new device driver embedded in the kernel and in the Device driver xxx_IOCONTROL I call the KernelIoControl(IOCTL_HAL_SHUTDOWN, NULL, 0, NULL, 0, NULL), is this function properly works?
Of course my application will use that driver to control the shutdown.
Thanks


Top
 Profile  
 
 Post subject: Re: SAM9263 Shutdown in user mode
PostPosted: Tue Jan 20, 2009 6:09 pm 
Offline

Joined: Fri May 14, 2004 9:58 am
Posts: 183
Location: France - USA
Hi,

Every device driver have kernel mode right access, so your solution is viable.

Regards,
Adeneo Support Team


Top
 Profile  
 
 Post subject: Re: SAM9263 Shutdown in user mode
PostPosted: Thu Jan 22, 2009 3:48 pm 
Offline

Joined: Fri Jan 16, 2009 10:46 pm
Posts: 44
many thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: