diff --git a/drivers/ddk/core.S b/drivers/ddk/core.S index 561f7c3938..373c7e01b1 100644 --- a/drivers/ddk/core.S +++ b/drivers/ddk/core.S @@ -13,6 +13,7 @@ .global _CreateEvent .global _CreateObject .global _CreateRingBuffer + .global _CreateThread .global _Delay .global _DestroyEvent @@ -81,6 +82,7 @@ .def _CreateEvent; .scl 2; .type 32; .endef .def _CreateObject; .scl 2; .type 32; .endef .def _CreateRingBuffer; .scl 2; .type 32; .endef + .def _CreateThread; .scl 2; .type 32; .endef .def _Delay; .scl 2; .type 32; .endef .def _DestroyEvent; .scl 2; .type 32; .endef @@ -149,6 +151,7 @@ _AttachIntHandler: _CreateEvent: _CreateObject: _CreateRingBuffer: +_CreateThread: _Delay: @@ -219,8 +222,8 @@ _WaitEventTimeout: .ascii " -export:CreateEvent" # .ascii " -export:CreateObject" # - .ascii " -export:CreateRingBuffer" # stdcall + .ascii " -export:CreateThread" # .ascii " -export:Delay" # stdcall diff --git a/drivers/include/drm/drm_mm.h b/drivers/include/drm/drm_mm.h index db85aa325e..523f487c29 100644 --- a/drivers/include/drm/drm_mm.h +++ b/drivers/include/drm/drm_mm.h @@ -36,7 +36,10 @@ /* * Generic range manager structs */ +#include +#include #include +#include #ifdef CONFIG_DEBUG_FS #include #endif diff --git a/drivers/include/drm/ttm/ttm_bo_api.h b/drivers/include/drm/ttm/ttm_bo_api.h index abc29f26fe..41c44b3409 100644 --- a/drivers/include/drm/ttm/ttm_bo_api.h +++ b/drivers/include/drm/ttm/ttm_bo_api.h @@ -32,12 +32,12 @@ #define _TTM_BO_API_H_ #include +#include #include #include #include #include #include -#include #include struct ttm_bo_device; @@ -195,7 +195,6 @@ struct ttm_buffer_object { enum ttm_bo_type type; void (*destroy) (struct ttm_buffer_object *); unsigned long num_pages; - uint64_t addr_space_offset; size_t acc_size; /** @@ -239,13 +238,7 @@ struct ttm_buffer_object { void *sync_obj; unsigned long priv_flags; - /** - * Members protected by the bdev::vm_lock - */ - -// struct rb_node vm_rb; - struct drm_mm_node *vm_node; - + struct drm_vma_offset_node vma_node; /** * Special members that are protected by the reserve lock diff --git a/drivers/include/drm/ttm/ttm_bo_driver.h b/drivers/include/drm/ttm/ttm_bo_driver.h index ed76920309..dcc21e6523 100644 --- a/drivers/include/drm/ttm/ttm_bo_driver.h +++ b/drivers/include/drm/ttm/ttm_bo_driver.h @@ -36,6 +36,7 @@ #include #include #include +#include //#include //#include #include @@ -538,14 +539,13 @@ struct ttm_bo_device { struct list_head device_list; struct ttm_bo_global *glob; struct ttm_bo_driver *driver; - rwlock_t vm_lock; struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; spinlock_t fence_lock; + /* - * Protected by the vm lock. + * Protected by internal locks. */ - struct rb_root addr_space_rb; - struct drm_mm addr_space_mm; + struct drm_vma_offset_manager vma_manager; /* * Protected by the global:lru lock. diff --git a/drivers/include/linux/kernel.h b/drivers/include/linux/kernel.h index 6efcd44a9b..308e1202ec 100644 --- a/drivers/include/linux/kernel.h +++ b/drivers/include/linux/kernel.h @@ -12,7 +12,7 @@ #include #include #include - +#include #include #define __init diff --git a/drivers/include/syscall.h b/drivers/include/syscall.h index 63fafdabdf..89897972dc 100644 --- a/drivers/include/syscall.h +++ b/drivers/include/syscall.h @@ -143,6 +143,19 @@ int dbgprintf(const char* format, ...); /////////////////////////////////////////////////////////////////////////////// +static inline int CreateKernelThread(void *entry) +{ + int pid; + __asm__ __volatile__ ( + "call *__imp__CreateThread" + :"=a"(pid) + :"b"(1),"c"(entry),"d"(0) + :"memory"); + __asm__ __volatile__ ("":::"ebx","ecx","edx","esi","edi"); + return pid; +}; + + static inline evhandle_t CreateEvent(kevent_t *ev, u32_t flags) { evhandle_t evh;