drivers: udpate ddk

git-svn-id: svn://kolibrios.org@3297 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-03-01 06:44:14 +00:00
parent 165c453d43
commit 1070204c9a
7 changed files with 1837 additions and 437 deletions

View File

@ -146,3 +146,19 @@ unsigned long usecs_to_jiffies(const unsigned int u)
#endif
}
unsigned long
timespec_to_jiffies(const struct timespec *value)
{
unsigned long sec = value->tv_sec;
long nsec = value->tv_nsec + TICK_NSEC - 1;
if (sec >= MAX_SEC_IN_JIFFIES){
sec = MAX_SEC_IN_JIFFIES;
nsec = 0;
}
return (((u64)sec * SEC_CONVERSION) +
(((u64)nsec * NSEC_CONVERSION) >>
(NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
}

File diff suppressed because it is too large Load Diff

View File

@ -171,7 +171,7 @@ int drm_err(const char *func, const char *format, ...);
/** \name Begin the DRM... */
/*@{*/
#define DRM_DEBUG_CODE 2 /**< Include debugging code if > 1, then
#define DRM_DEBUG_CODE 0 /**< Include debugging code if > 1, then
also include looping detection. */
#define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */

View File

@ -31,4 +31,6 @@ struct scatterlist {
#define sg_dma_len(sg) ((sg)->length)
#endif
#define ARCH_HAS_SG_CHAIN
#endif /* __ASM_GENERIC_SCATTERLIST_H */

View File

@ -202,7 +202,7 @@ static inline int list_empty(const struct list_head *head)
*/
static inline int list_empty_careful(const struct list_head *head)
{
struct list_head *next = head->next;
struct list_head *next = head->next;
return (next == head) && (next == head->prev);
}

View File

@ -229,7 +229,7 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
* Maximum number of entries that will be allocated in one piece, if
* a list larger than this is required then chaining will be utilized.
*/
#define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist))
#define SG_MAX_SINGLE_ALLOC (4*PAGE_SIZE / sizeof(struct scatterlist))
/*

View File

@ -1,6 +1,7 @@
#ifndef _LINUX_WAIT_H
#define _LINUX_WAIT_H
#include <linux/list.h>
#include <syscall.h>
typedef struct __wait_queue wait_queue_t;
@ -39,7 +40,6 @@ do { \
#define wait_event_timeout(wq, condition, timeout) \
({ \
long __ret = timeout; \
@ -48,7 +48,7 @@ do{ \
.task_list = LIST_HEAD_INIT(__wait.task_list), \
.evnt = CreateEvent(NULL, MANUAL_DESTROY), \
}; \
u32 flags; \
unsigned long flags; \
\
spin_lock_irqsave(&wq.lock, flags); \
if (list_empty(&__wait.task_list)) \
@ -60,7 +60,7 @@ do{ \
break; \
WaitEvent(__wait.evnt); \
}; \
if (!list_empty_careful(&__wait.task_list)) { \
if (!list_empty(&__wait.task_list)) { \
spin_lock_irqsave(&wq.lock, flags); \
list_del_init(&__wait.task_list); \
spin_unlock_irqrestore(&wq.lock, flags); \
@ -80,7 +80,7 @@ do{ \
.task_list = LIST_HEAD_INIT(__wait.task_list), \
.evnt = CreateEvent(NULL, MANUAL_DESTROY), \
}; \
u32 flags; \
unsigned long flags; \
\
spin_lock_irqsave(&wq.lock, flags); \
if (list_empty(&__wait.task_list)) \
@ -112,6 +112,8 @@ void wake_up_all(wait_queue_head_t *q)
spin_lock_irqsave(&q->lock, flags);
list_for_each_entry(curr, &q->task_list, task_list)
{
// printf("raise event \n");
kevent_t event;
event.code = -1;
RaiseEvent(curr->evnt, 0, &event);