你好,游客 登录 注册 搜索
背景:
阅读新闻

mini6410 实现 看门狗移植--muge0913版

[日期:2011-12-12] 来源:csdn  作者:muge0913 [字体:大 中 小]

原因分析:

open函数:

  1. static int s3c2410wdt_open(struct inode *inode, struct file *file)  
  • {  
  •     if (test_and_set_bit(0, &open_lock))  
  •         return -EBUSY;  
  •   
  •     if (nowayout)  
  •         __module_get(THIS_MODULE);  
  •   
  •     expect_close = 0;  
  •   
  •     /* start the timer */  
  •     s3c2410wdt_start();  
  •     return nonseekable_open(inode, file);  
  • }  
  • release函数:

    1. static int s3c2410wdt_release(struct inode *inode, struct file *file)  
    2. {  
    3.     /* 
    4.      *  Shut off the timer. 
    5.      *  Lock it in if it's a module and we set nowayout 
    6.      */  
    7.   
    8.     if (expect_close == 42)  
    9.         s3c2410wdt_stop();  
    10.     else {  
    11.         dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n");  
    12.         s3c2410wdt_keepalive();  
    13.     }  
    14.     expect_close = 0;  
    15.     clear_bit(0, &open_lock);  
    16.     return 0;  
    17. }  
    linux
    相关资讯       mini6410 
    本文评论   查看全部评论 (0)
    表情: 表情 姓名: 字数

           

    评论声明
    • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
    • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
    • 本站管理人员有权保留或删除其管辖留言中的任意内容
    • 本站有权在网站内转载或引用您的评论
    • 参与本评论即表明您已经阅读并接受上述条款