stc.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:2k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __STC_H
  2. #define __STC_H
  3. #include "types.h"
  4. #include "regmap.h"
  5. //
  6. // inline
  7. #define get_stc_16_inline()    (regs0->stc_15_0)
  8. #define get_stc_32_inline()    (regs0->stc_15_0 | (regs0->stc_31_16<<16))
  9. //
  10. // kernel function
  11. extern UINT32 _get_stc_32(void);
  12. extern INT64 _get_stc(void);
  13. extern UINT32 _get_rtc(void);
  14. #define get_stc_16()    get_stc_16_inline()
  15. #define get_stc_32() _get_stc_32()
  16. #define get_stc() _get_stc()
  17. #define get_rtc() _get_rtc()
  18. #define set_astc(stc)   
  19. do {                                    
  20.             UINT32 __sl = (stc);         
  21.             UINT32 __sh = (UINT64)(stc)>>32;    
  22.             regs0->stc_32       = __sh;         
  23.             regs0->stc_31_16    = __sl>>16;     
  24.             regs0->stc_15_0     = __sl;         
  25. } while (0)
  26. #define set_stc(stc)    
  27.         do {                
  28.             set_astc(stc);  
  29.         } while (0) 
  30. #define set_sstc(n,stc) 
  31.         do {                
  32.             set_astc(stc);  
  33.         } while (0) 
  34. #define set_rtc(v)  
  35.         do {                                
  36.             regs0->rtc_31_16 = ((v)>>16);   
  37.             regs0->rtc_15_0  = ((v));       
  38.         } while (0)
  39. #define reset_rtc() (regs0->rtc_31_16=0)
  40. extern UINT8   STC_state;
  41. #define STCST_INIT 0
  42. #define STCST_TRACKVPTS 1
  43. #define STCST_LOCKED 3
  44. #define set_stc_valid() (STC_state=STCST_LOCKED)
  45. #define set_stc_init() (STC_state=STCST_INIT)
  46. #define set_stc_track() (STC_state=STCST_TRACKVPTS)
  47. #define is_stc_valid() (STC_state==STCST_LOCKED)
  48. #define is_stc_track() (STC_state==STCST_TRACKVPTS)
  49. #define is_stc_init() (STC_state==STCST_INIT)
  50. #endif/*__STC_H*/