how to call ioctl function for watchdog..

Chan Kim ckim at etri.re.kr
Wed Nov 25 12:44:19 UTC 2015


This morning, I solved this by using rtems_io_register_name /dev/wdt0 and opening /dev/wdt0 and added some CONFIGURE_...s.
also I had to add return RTEMS_SUCCESSFUL in the added Watchdog_open function. Just to let anyone curious know..
Thanks.
Chan





보낸 사람 : "Chan Kim" <ckim at etri.re.kr>
보낸 날짜 : 2015-11-24 21:43:04 ( +09:00 )
받는 사람 : users at rtems.org <users at rtems.org>
참조 : 
제목 : how to call ioctl function for watchdog..


Hello, rtems users and experts,

I am trying to use a timer with watchdog capability as a watchdog in rtems.
I saw in rtems-4.10.99-src/cpukit/libcsupport/include/rtems/watchdogdrv.h below definition.
#define WATCHDOG_DRIVER_TABLE_ENTRY \
{ Watchdog_initialize, NULL, NULL, NULL, NULL, Watchdog_control }

so I added my .c and .h to the build tree and added this Watchdog_initialize and Watchdog_control function.
When I add CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER, the driver entry is added to the driver table.

during the drivers init stage, I see Watchdog_initialize is called. In the initialize function, I used
rtems_io_register_name("/dev/wdt", major, 0);
which was successful.
Then in the application, I did fd = open("/dev/wdt", O_RDWR); but it's not successful.
of course when I do ioctl(fd, MYCMD, myvar); in the application, it is not connected to my Watchdog_control function.

It maybe because the open function is not defined. But in the original watchdogdrv.h (libcsupport), why isn't there open function?
(I understand this file is not supposed to be altered by user)
Can I just add an open function in the watchdogdrv.h and my implementation code for watchdog, and expect the open("/dev/wdt"..) to work?
Thanks!

Chan
_______________________________________________
users mailing list
users at rtems.org
http://lists.rtems.org/mailman/listinfo/users


More information about the users mailing list