forked from KolibriOS/kolibrios
ddk: update
git-svn-id: svn://kolibrios.org@4125 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
2b454bada8
commit
5527aca48a
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
.global _AttachIntHandler
|
.global _AttachIntHandler
|
||||||
|
|
||||||
|
.global _CancelTimerHS
|
||||||
.global _CreateEvent
|
.global _CreateEvent
|
||||||
.global _CreateObject
|
.global _CreateObject
|
||||||
.global _CreateRingBuffer
|
.global _CreateRingBuffer
|
||||||
@ -64,7 +65,7 @@
|
|||||||
.global _SetScreen
|
.global _SetScreen
|
||||||
.global _SysMsgBoardStr
|
.global _SysMsgBoardStr
|
||||||
|
|
||||||
.global _TimerHs
|
.global _TimerHS
|
||||||
|
|
||||||
.global _UserAlloc
|
.global _UserAlloc
|
||||||
.global _UserFree
|
.global _UserFree
|
||||||
@ -79,6 +80,7 @@
|
|||||||
|
|
||||||
.def _AttachIntHandler; .scl 2; .type 32; .endef
|
.def _AttachIntHandler; .scl 2; .type 32; .endef
|
||||||
|
|
||||||
|
.def _CancelTimerHS; .scl 2; .type 32; .endef
|
||||||
.def _CreateEvent; .scl 2; .type 32; .endef
|
.def _CreateEvent; .scl 2; .type 32; .endef
|
||||||
.def _CreateObject; .scl 2; .type 32; .endef
|
.def _CreateObject; .scl 2; .type 32; .endef
|
||||||
.def _CreateRingBuffer; .scl 2; .type 32; .endef
|
.def _CreateRingBuffer; .scl 2; .type 32; .endef
|
||||||
@ -133,7 +135,7 @@
|
|||||||
.def _SetKeyboardData; .scl 2; .type 32; .endef
|
.def _SetKeyboardData; .scl 2; .type 32; .endef
|
||||||
.def _SysMsgBoardStr; .scl 2; .type 32; .endef
|
.def _SysMsgBoardStr; .scl 2; .type 32; .endef
|
||||||
|
|
||||||
.def _TimerHs; .scl 2; .type 32; .endef
|
.def _TimerHS; .scl 2; .type 32; .endef
|
||||||
|
|
||||||
.def _UserAlloc; .scl 2; .type 32; .endef
|
.def _UserAlloc; .scl 2; .type 32; .endef
|
||||||
.def _UserFree; .scl 2; .type 32; .endef
|
.def _UserFree; .scl 2; .type 32; .endef
|
||||||
@ -148,6 +150,7 @@ _AllocPages:
|
|||||||
|
|
||||||
_AttachIntHandler:
|
_AttachIntHandler:
|
||||||
|
|
||||||
|
_CancelTimerHS:
|
||||||
_CreateEvent:
|
_CreateEvent:
|
||||||
_CreateObject:
|
_CreateObject:
|
||||||
_CreateRingBuffer:
|
_CreateRingBuffer:
|
||||||
@ -202,7 +205,7 @@ _SetKeyboardData:
|
|||||||
_SetScreen:
|
_SetScreen:
|
||||||
_SysMsgBoardStr:
|
_SysMsgBoardStr:
|
||||||
|
|
||||||
_TimerHs:
|
_TimerHS:
|
||||||
|
|
||||||
_UserAlloc:
|
_UserAlloc:
|
||||||
_UserFree:
|
_UserFree:
|
||||||
@ -220,16 +223,15 @@ _WaitEventTimeout:
|
|||||||
|
|
||||||
.ascii " -export:AttachIntHandler" # stdcall
|
.ascii " -export:AttachIntHandler" # stdcall
|
||||||
|
|
||||||
|
.ascii " -export:CancelTimerHS" # stfcall
|
||||||
.ascii " -export:CreateEvent" #
|
.ascii " -export:CreateEvent" #
|
||||||
.ascii " -export:CreateObject" #
|
.ascii " -export:CreateObject" #
|
||||||
.ascii " -export:CreateRingBuffer" # stdcall
|
.ascii " -export:CreateRingBuffer" # stdcall
|
||||||
.ascii " -export:CreateThread" #
|
.ascii " -export:CreateThread" #
|
||||||
|
|
||||||
.ascii " -export:Delay" # stdcall
|
.ascii " -export:Delay" # stdcall
|
||||||
|
|
||||||
.ascii " -export:DestroyEvent"
|
.ascii " -export:DestroyEvent"
|
||||||
.ascii " -export:DestroyObject"
|
.ascii " -export:DestroyObject"
|
||||||
|
|
||||||
.ascii " -export:DiskAdd" # stdcall
|
.ascii " -export:DiskAdd" # stdcall
|
||||||
.ascii " -export:DiskMediaChanged" # stdcall
|
.ascii " -export:DiskMediaChanged" # stdcall
|
||||||
|
|
||||||
@ -237,7 +239,6 @@ _WaitEventTimeout:
|
|||||||
.ascii " -export:FreePage" #
|
.ascii " -export:FreePage" #
|
||||||
|
|
||||||
.ascii " -export:GetCpuFreq" #
|
.ascii " -export:GetCpuFreq" #
|
||||||
|
|
||||||
.ascii " -export:GetDisplay" # stdcall
|
.ascii " -export:GetDisplay" # stdcall
|
||||||
.ascii " -export:GetEvent" #
|
.ascii " -export:GetEvent" #
|
||||||
.ascii " -export:GetPid" #
|
.ascii " -export:GetPid" #
|
||||||
@ -276,7 +277,7 @@ _WaitEventTimeout:
|
|||||||
.ascii " -export:SetScreen" # stdcall
|
.ascii " -export:SetScreen" # stdcall
|
||||||
.ascii " -export:SysMsgBoardStr" # stdcall
|
.ascii " -export:SysMsgBoardStr" # stdcall
|
||||||
|
|
||||||
.ascii " -export:TimerHs" # stdcall
|
.ascii " -export:TimerHS" # stdcall
|
||||||
|
|
||||||
.ascii " -export:UserAlloc" # stdcall
|
.ascii " -export:UserAlloc" # stdcall
|
||||||
.ascii " -export:UserFree" # stdcall
|
.ascii " -export:UserFree" # stdcall
|
||||||
|
@ -94,7 +94,7 @@ int queue_delayed_work(struct workqueue_struct *wq,
|
|||||||
// dbgprintf("%s %p queue: %p\n", __FUNCTION__, &dwork->work, wq);
|
// dbgprintf("%s %p queue: %p\n", __FUNCTION__, &dwork->work, wq);
|
||||||
|
|
||||||
work->data = wq;
|
work->data = wq;
|
||||||
TimerHs(delay,0, delayed_work_timer_fn, dwork);
|
TimerHS(delay,0, delayed_work_timer_fn, dwork);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,3 +104,20 @@ bool schedule_delayed_work(struct delayed_work *dwork, unsigned long delay)
|
|||||||
return queue_delayed_work(system_wq, dwork, delay);
|
return queue_delayed_work(system_wq, dwork, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mod_timer(struct timer_list *timer, unsigned long expires)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
expires - GetTimerTicks();
|
||||||
|
|
||||||
|
if(timer->handle)
|
||||||
|
{
|
||||||
|
CancelTimerHS(timer->handle);
|
||||||
|
timer->handle = 0;
|
||||||
|
ret = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
timer->handle = TimerHS(expires, 0, timer->function, timer->data);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -273,10 +273,17 @@ struct timer_list {
|
|||||||
|
|
||||||
void (*function)(unsigned long);
|
void (*function)(unsigned long);
|
||||||
unsigned long data;
|
unsigned long data;
|
||||||
|
u32 handle;
|
||||||
// struct tvec_base *base;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define setup_timer(_timer, _fn, _data) \
|
||||||
|
do { \
|
||||||
|
(_timer)->function = (_fn); \
|
||||||
|
(_timer)->data = (_data); \
|
||||||
|
(_timer)->handle = 0; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
struct timespec {
|
struct timespec {
|
||||||
long tv_sec; /* seconds */
|
long tv_sec; /* seconds */
|
||||||
long tv_nsec; /* nanoseconds */
|
long tv_nsec; /* nanoseconds */
|
||||||
|
@ -61,6 +61,7 @@ struct workqueue_struct *alloc_workqueue_key(const char *fmt,
|
|||||||
#define alloc_ordered_workqueue(fmt, flags, args...) \
|
#define alloc_ordered_workqueue(fmt, flags, args...) \
|
||||||
alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args)
|
alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args)
|
||||||
|
|
||||||
|
bool queue_work(struct workqueue_struct *wq, struct work_struct *work);
|
||||||
int queue_delayed_work(struct workqueue_struct *wq,
|
int queue_delayed_work(struct workqueue_struct *wq,
|
||||||
struct delayed_work *dwork, unsigned long delay);
|
struct delayed_work *dwork, unsigned long delay);
|
||||||
|
|
||||||
@ -80,6 +81,10 @@ bool schedule_delayed_work(struct delayed_work *dwork, unsigned long delay);
|
|||||||
(_work)->work.func = _func; \
|
(_work)->work.func = _func; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
static inline bool schedule_work(struct work_struct *work)
|
||||||
|
{
|
||||||
|
return queue_work(system_wq, work);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _LINUX_WORKQUEUE_H */
|
#endif /* _LINUX_WORKQUEUE_H */
|
||||||
|
@ -55,8 +55,10 @@ void FASTCALL MutexUnlock(struct mutex*)__asm__("MutexUnlock");
|
|||||||
addr_t IMPORT GetStackBase(void)__asm__("GetStackBase");
|
addr_t IMPORT GetStackBase(void)__asm__("GetStackBase");
|
||||||
u32_t IMPORT GetPid(void)__asm__("GetPid");
|
u32_t IMPORT GetPid(void)__asm__("GetPid");
|
||||||
|
|
||||||
u32 STDCALL TimerHs(u32 delay, u32 interval,
|
u32 STDCALL TimerHS(u32 delay, u32 interval,
|
||||||
void *fn, void *data)asm("TimerHs");
|
void *fn, void *data)asm("TimerHS");
|
||||||
|
|
||||||
|
void STDCALL CancelTimerHS(u32 handle)asm("CancelTimerHS");
|
||||||
|
|
||||||
u64 IMPORT GetCpuFreq()__asm__("GetCpuFreq");
|
u64 IMPORT GetCpuFreq()__asm__("GetCpuFreq");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user