restart.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:1k
源码类别:

DVD

开发平台:

C/C++

  1. #include "stsys.h"
  2. #include "sttbx.h"
  3. #include <stdio.h>
  4. #include <stdarg.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include "Gendef.h"
  8. #include "appltype.h"
  9. #define SYS_SERVICES_BASE_ADDRESS   0x20F00000
  10. ST_ErrorCode_t KB_Restart(void)
  11. {
  12. U32 CodeReceived;
  13. STTBX_Print(("ENTERING SingapplRestart ......  n"));
  14. printf("ENTERING SingapplRestart ......  n");
  15. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x300, 0x00F0);
  16. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x300, 0x000F);
  17. CodeReceived = STSYS_ReadRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x300);
  18. STTBX_Print(("***LOCK STATUS = %08Xn", CodeReceived));
  19. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x110, 0x02);
  20. CodeReceived = STSYS_ReadRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x140) | 0x0180;
  21. STTBX_Print(("***RESET STATUS = %08X ---changed to = ", CodeReceived));
  22. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x140, 0x0180);
  23. CodeReceived = STSYS_ReadRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x140);
  24. STTBX_Print(("%08Xn", CodeReceived));
  25. STTBX_Print(("Enabling WATCHDOG...n"));
  26. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x130, 0x01);
  27. STSYS_WriteRegDev32LE(SYS_SERVICES_BASE_ADDRESS + 0x134, 0x10);
  28. return ST_NO_ERROR;
  29. }
  30. /* EOF */