Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 378 → Rev 379

/shark/trunk/ports/didma/didma.c
201,7 → 201,7
int new_len;
// first level = log2 (size)
*fl = log2size (size, &new_len);
*fl = log2size (size, (size_t *)&new_len);
if (new_len == size) {
// if 2**fl == size, second level must be 0
235,7 → 235,7
 
total_size = size;
 
MAX_FL_INDEX = log2size(size, &dummy);
MAX_FL_INDEX = log2size(size, (size_t *)&dummy);
 
if (MAX_FL_INDEX < 0) return -1;
fl_array = (fl_array_t *) SYSTEM_MALLOC ((MAX_FL_INDEX - MIN_LOG2_SIZE)
/shark/trunk/ports/didma/include/didma.h
14,7 → 14,6
#include <kernel/mem.h>
#include <stdio.h>
 
#define size_t unsigned int
/*
* if __DEBUG__ is defined several functions like mem_dump(),
* free_blocks_context() will be availables.
/shark/trunk/libc/stdlib/qsort.c
56,7 → 56,7
log(MAX_THRESH)). Since total_elements has type size_t, we get as
upper bound for log (total_elements):
bits per byte (CHAR_BIT) * sizeof(size_t). */
#define STACK_SIZE (CHAR_BIT * sizeof(size_t))
#define QSORT_STACK_SIZE (CHAR_BIT * sizeof(size_t))
#define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
#define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi)))
#define STACK_NOT_EMPTY (stack < top)
102,7 → 102,7
{
char *lo = base_ptr;
char *hi = &lo[size * (total_elems - 1)];
stack_node stack[STACK_SIZE];
stack_node stack[QSORT_STACK_SIZE];
stack_node *top = stack + 1;
 
while (STACK_NOT_EMPTY)
199,7 → 199,6
of the array to sort, and END_PTR points at the very last element in
the array (*not* one beyond it!). */
 
#define min(x, y) ((x) < (y) ? (x) : (y))
 
{
char *const end_ptr = &base_ptr[size * (total_elems - 1)];
/shark/trunk/drivers/svga/glib.c
12,16 → 12,16
 
inline void memsetw(void *dst, unsigned int c, unsigned long int memdiv2)
{
__asm__ __volatile__("push %%edi
push %%eax
push %%ecx
movl %2, %%edi
cld
rep
stosw
pop %%ecx
pop %%eax
pop %%edi"
__asm__ __volatile__("push %%edi\n\t"
"push %%eax\n\t"
"push %%ecx\n\t"
"movl %2, %%edi\n\t"
"cld\n\t"
"rep\n\t"
"stosw\n\t"
"pop %%ecx\n\t"
"pop %%eax\n\t"
"pop %%edi\n\t"
:
: "c" (memdiv2), "a" (c), "b" (dst));
 
/shark/trunk/drivers/svga/vga.c
1343,65 → 1343,65
 
inline void copy_videomem_32to16(void *src, void *dst, unsigned long int memdiv2)
{
__asm__ __volatile__("push %%esi
push %%edi
movl %1, %%esi
movl %2, %%edi
1:
movl (%%esi), %%edx
xorl %%ebx, %%ebx
xorw %%ax, %%ax
movb %%dl, %%al
shrl $0x8, %%edx
shrw $0x3, %%ax
orw %%ax, %%bx
shll $0x6, %%ebx
xorw %%ax, %%ax
movb %%dl, %%al
shrl $0x8, %%edx
shrw $0x2, %%ax
orw %%ax, %%bx
shll $0x5, %%ebx
xorw %%ax, %%ax
movb %%dl, %%al
shrw $0x3, %%ax
orw %%ax, %%bx
shll $0x5, %%ebx
incl %%esi
incl %%esi
incl %%esi
incl %%esi
movl (%%esi), %%edx
xorw %%ax, %%ax
movb %%dl, %%al
shrl $0x8,%%edx
shrw $0x3, %%ax
orw %%ax, %%bx
shll $0x6, %%ebx
xorw %%ax, %%ax
movb %%dl, %%al
shrl $0x8, %%edx
shrw $0x2, %%ax
orw %%ax, %%bx
shll $0x5, %%ebx
xorw %%ax, %%ax
movb %%dl, %%al
shrw $0x3, %%ax
orw %%ax, %%bx
rorl $0x10, %%ebx
movl %%ebx, (%%edi)
incl %%esi
incl %%esi
incl %%esi
incl %%esi
incl %%edi
incl %%edi
incl %%edi
incl %%edi
loop 1b
pop %%edi
pop %%esi"
:
__asm__ __volatile__("push %%esi\n\t"
"push %%edi\n\t"
"movl %1, %%esi\n\t"
"movl %2, %%edi\n\t"
"1:\n\t"
"movl (%%esi), %%edx\n\t"
"xorl %%ebx, %%ebx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrl $0x8, %%edx\n\t"
"shrw $0x3, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"shll $0x6, %%ebx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrl $0x8, %%edx\n\t"
"shrw $0x2, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"shll $0x5, %%ebx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrw $0x3, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"shll $0x5, %%ebx\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"movl (%%esi), %%edx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrl $0x8,%%edx\n\t"
"shrw $0x3, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"shll $0x6, %%ebx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrl $0x8, %%edx\n\t"
"shrw $0x2, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"shll $0x5, %%ebx\n\t"
"xorw %%ax, %%ax\n\t"
"movb %%dl, %%al\n\t"
"shrw $0x3, %%ax\n\t"
"orw %%ax, %%bx\n\t"
"rorl $0x10, %%ebx\n\t"
"movl %%ebx, (%%edi)\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"incl %%esi\n\t"
"incl %%edi\n\t"
"incl %%edi\n\t"
"incl %%edi\n\t"
"incl %%edi\n\t"
"loop 1b\n\t"
"pop %%edi\n\t"
"pop %%esi\n\t"
:
: "c" (memdiv2), "a" (src), "b" (dst));
 
}
1408,16 → 1408,16
 
inline void copy_videomem_16to16(void *src, void *dst, unsigned long int memdiv4)
{
__asm__ __volatile__("push %%esi
push %%edi
movl %1, %%esi
movl %2, %%edi
cld
rep
movsl
__asm__ __volatile__("push %%esi\n\t"
"push %%edi\n\t"
"movl %1, %%esi\n\t"
"movl %2, %%edi\n\t"
"cld\n\t"
"rep\n\t"
"movsl\n\t"
pop %%edi
pop %%esi"
"pop %%edi\n\t"
"pop %%esi\n\t"
:
: "c" (memdiv4), "a" (src), "b" (dst));