mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-23 23:26:49 +03:00
newlib: struct dirent
pixlib3: enable linear texture filtration libsync: user space synchronization git-svn-id: svn://kolibrios.org@5602 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
fb406006f7
commit
1918b713af
@ -5,9 +5,16 @@ LIB_DIR:= $(abspath ../lib)
|
||||
|
||||
# targets
|
||||
|
||||
all: newlib zlib libpng freetype pixman cairo \
|
||||
all: libsync newlib zlib libpng freetype pixman cairo \
|
||||
libdrm pixlib ffmpeg libsupc++ libstdc++ gcc_eh expat \
|
||||
Mesa eglut sound
|
||||
Mesa eglut vaapi sound
|
||||
|
||||
libsync: $(LIB_DIR)/libsync.a
|
||||
|
||||
$(LIB_DIR)/libsync.a:
|
||||
$(MAKE) -C libsync
|
||||
|
||||
#####################################
|
||||
|
||||
newlib: $(DLL_DIR)/libc.dll $(LIB_DIR)/libc.dll.a $(LIB_DIR)/libapp.a $(LIB_DIR)/libdll.a
|
||||
|
||||
@ -60,10 +67,10 @@ $(DLL_DIR)/libdrm.dll $(LIB_DIR)/libdrm.dll.a $(LIB_DIR)/libdrm.a: newlib
|
||||
|
||||
#####################################
|
||||
|
||||
pixlib: $(DLL_DIR)/pixlib.dll
|
||||
pixlib: $(LIB_DIR)/libpixlib3.a
|
||||
|
||||
$(DLL_DIR)/pixlib.dll: newlib libdrm
|
||||
$(MAKE) -C Intel-2D
|
||||
$(LIB_DIR)/libpixlib3.a: newlib libdrm Mesa
|
||||
$(MAKE) -C pixlib-3
|
||||
|
||||
#####################################
|
||||
|
||||
@ -117,7 +124,7 @@ Mesa: $(DLL_DIR)/libGL.dll $(DLL_DIR)/libegl.dll $(DLL_DIR)/i965_dri.drv
|
||||
$(DLL_DIR)/libGL.dll $(DLL_DIR)/libegl.dll $(DLL_DIR)/i965_dri.drv \
|
||||
$(LIB_DIR)/libGL.dll.a $(LIB_DIR)/libegl.dll.a \
|
||||
$(LIB_DIR)/libglsl.a: newlib libdrm libsupc++ gcc_eh expat
|
||||
$(MAKE) -C Mesa
|
||||
$(MAKE) -C Mesa/mesa-9.2.5
|
||||
|
||||
#####################################
|
||||
|
||||
@ -128,6 +135,17 @@ $(DLL_DIR)/libeglut.dll $(LIB_DIR)/libeglut.dll.a $(LIB_DIR)/libeglut.a : newlib
|
||||
|
||||
#####################################
|
||||
|
||||
vaapi: $(DLL_DIR)/i65-video.dll $(DLL_DIR)/libva.dll
|
||||
|
||||
$(DLL_DIR)/i65-video.dll : newlib libdrm
|
||||
$(MAKE) -C vaapi/intel-driver-1.4.1
|
||||
|
||||
$(DLL_DIR)/libva.dll : newlib libdrm
|
||||
$(MAKE) -C vaapi/libva-1.4.1
|
||||
|
||||
#####################################
|
||||
|
||||
|
||||
sound: $(LIB_DIR)/libsound.a
|
||||
|
||||
$(LIB_DIR)/libsound.a :
|
||||
|
32
contrib/sdk/sources/libsync/Makefile
Normal file
32
contrib/sdk/sources/libsync/Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
LIBRARY= libsync
|
||||
|
||||
FASM = fasm.exe
|
||||
AR = kos32-ar
|
||||
ARFLAGS = crs
|
||||
|
||||
SRCS = mutex.asm \
|
||||
m_destroy.asm \
|
||||
m_lock.asm \
|
||||
m_try.asm \
|
||||
m_unlock.asm \
|
||||
$(NULL)
|
||||
|
||||
OBJS = $(patsubst %.asm, %.o, $(SRCS))
|
||||
|
||||
# targets
|
||||
|
||||
all: libsync.a
|
||||
|
||||
libsync.a: $(OBJS) Makefile
|
||||
$(AR) $(ARFLAGS) libsync.a $(OBJS)
|
||||
mv -f libsync.a ../../lib
|
||||
|
||||
%.o : %.asm Makefile
|
||||
$(FASM) $< $@
|
||||
|
||||
clean:
|
||||
-rm -f *.o
|
||||
|
||||
|
||||
|
||||
|
18
contrib/sdk/sources/libsync/m_destroy.asm
Normal file
18
contrib/sdk/sources/libsync/m_destroy.asm
Normal file
@ -0,0 +1,18 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_destroy@4
|
||||
|
||||
@mutex_destroy@4:
|
||||
push ebx
|
||||
mov ecx, [ecx+MUTEX.handle]
|
||||
mov eax, 77
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
pop ebx
|
||||
ret
|
41
contrib/sdk/sources/libsync/m_lock.asm
Normal file
41
contrib/sdk/sources/libsync/m_lock.asm
Normal file
@ -0,0 +1,41 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_lock@4
|
||||
|
||||
@mutex_lock@4:
|
||||
|
||||
mov eax, 1
|
||||
lock xadd [ecx+MUTEX.lock], eax
|
||||
test eax, eax
|
||||
jnz .slow
|
||||
ret
|
||||
.slow:
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
mov edi, ecx
|
||||
mov ecx, [edi+MUTEX.handle]
|
||||
mov edx, 2
|
||||
mov ebx, edx
|
||||
xor esi, esi
|
||||
align 4
|
||||
.again:
|
||||
mov eax, edx
|
||||
xchg eax, [edi+MUTEX.lock]
|
||||
test eax, eax
|
||||
jz .ok
|
||||
|
||||
mov eax, 77
|
||||
int 0x40
|
||||
jmp .again
|
||||
.ok:
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
ret
|
17
contrib/sdk/sources/libsync/m_try.asm
Normal file
17
contrib/sdk/sources/libsync/m_try.asm
Normal file
@ -0,0 +1,17 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_trylock@4
|
||||
|
||||
@mutex_trylock@4:
|
||||
mov edx, 1
|
||||
xor eax, eax
|
||||
lock cmpxchg [ecx+MUTEX.lock], edx
|
||||
setz al
|
||||
movzx eax, al
|
||||
ret
|
26
contrib/sdk/sources/libsync/m_unlock.asm
Normal file
26
contrib/sdk/sources/libsync/m_unlock.asm
Normal file
@ -0,0 +1,26 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_unlock@4
|
||||
|
||||
@mutex_unlock@4:
|
||||
xor eax, eax
|
||||
xchg eax, [ecx]
|
||||
cmp eax, 1
|
||||
jnz .wake
|
||||
|
||||
ret
|
||||
.wake:
|
||||
push ebx
|
||||
mov edx, 1
|
||||
mov ecx, [ecx+MUTEX.handle]
|
||||
mov ebx, 3
|
||||
mov eax, 77
|
||||
int 0x40
|
||||
pop ebx
|
||||
retn
|
19
contrib/sdk/sources/libsync/mutex.asm
Normal file
19
contrib/sdk/sources/libsync/mutex.asm
Normal file
@ -0,0 +1,19 @@
|
||||
format MS COFF
|
||||
use32
|
||||
|
||||
MUTEX.lock equ 0
|
||||
MUTEX.handle equ 4
|
||||
|
||||
section '.text' align 16 code readable executable
|
||||
|
||||
public @mutex_init@4
|
||||
|
||||
@mutex_init@4:
|
||||
push ebx
|
||||
xor ebx, ebx
|
||||
mov eax, 77
|
||||
mov [ecx+MUTEX.lock], ebx
|
||||
int 0x40
|
||||
mov [ecx+MUTEX.handle], eax
|
||||
pop ebx
|
||||
ret
|
16
contrib/sdk/sources/newlib/libc/include/libsync.h
Normal file
16
contrib/sdk/sources/newlib/libc/include/libsync.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef __LBSYNC_H__
|
||||
#define __LBSYNC_H__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile int lock;
|
||||
unsigned int handle;
|
||||
}mutex_t;
|
||||
|
||||
int __fastcall mutex_init(mutex_t *mutex);
|
||||
int __fastcall mutex_destroy(mutex_t *mutex);
|
||||
void __fastcall mutex_lock(mutex_t *mutex);
|
||||
int __fastcall mutex_trylock (mutex_t *mutex);
|
||||
void __fastcall mutex_unlock(mutex_t *mutex);
|
||||
|
||||
#endif
|
@ -7,7 +7,26 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
//#error "<dirent.h> not supported"
|
||||
|
||||
struct dirent {
|
||||
char d_namlen;
|
||||
char d_name[256];
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// struct systree_info2 fileinfo;
|
||||
struct dirent entry;
|
||||
// __u8 bdfeheader[0x20];
|
||||
// struct bdfe_item bdfebase;
|
||||
// __u8 bdfename[264];
|
||||
} DIR;
|
||||
|
||||
int closedir(DIR *dirp);
|
||||
DIR * opendir(const char *_dirname);
|
||||
struct dirent * readdir(DIR *_dirp);
|
||||
void rewinddir(DIR *_dirp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
1768
contrib/sdk/sources/newlib/libc/include/zlib.h
Normal file
1768
contrib/sdk/sources/newlib/libc/include/zlib.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -41,8 +41,8 @@ static EGLImageKHR px_create_image(struct render *px,void *name,GLuint tex, EGLi
|
||||
if(glGetError() != GL_NO_ERROR)
|
||||
goto err_1;
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
|
||||
|
||||
return image;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user