From 13e75fd71094edf060fc71b64f87fca209120994 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Fri, 4 Dec 1998 23:35:48 +0000 Subject: [PATCH] cleanup to support incorporated changes svn path=/trunk/; revision=109 --- reactos/drivers/dd/ide/ide.c | 11 +- reactos/drivers/dd/ide/ide.h | 9 +- reactos/iface/native/genntdll.c | 7 + reactos/iface/native/sysfuncs.lst | 18 + reactos/include/ddk/li.h | 20 + reactos/include/wstring.h | 10 +- reactos/lib/kernel32/misc/atom.c | 7 +- reactos/lib/ntdll/napi.asm | 164 +++++ reactos/ntoskrnl/ex/napi.c | 2 +- reactos/ntoskrnl/hal/x86/printk.c | 54 +- reactos/ntoskrnl/io/irp.c | 2 +- reactos/ntoskrnl/rtl/wstring.c | 1141 +++++++++++++---------------- 12 files changed, 782 insertions(+), 663 deletions(-) create mode 100644 reactos/include/ddk/li.h diff --git a/reactos/drivers/dd/ide/ide.c b/reactos/drivers/dd/ide/ide.c index 4ad74164ffb..ec8dfe111a5 100644 --- a/reactos/drivers/dd/ide/ide.c +++ b/reactos/drivers/dd/ide/ide.c @@ -74,7 +74,7 @@ typedef DISK_GEOMETRY *PDISK_GEOMETRY; #include #include -//#define NDEBUG +#define NDEBUG #include #include "ide.h" @@ -237,7 +237,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, BOOLEAN WeGotSomeDisks; int ControllerIdx; - DPRINT("IDE Driver %s\n", VERSION); + DbgPrint("IDE Driver %s\n", VERSION); // Export other driver entry points... DriverObject->DriverStartIo = IDEStartIo; @@ -302,7 +302,7 @@ IDECreateController(IN PDRIVER_OBJECT DriverObject, ControllerParams->ControlPortBase)) { DPRINT("Could not find controller %d at %04lx\n", - ControllerIdx, ControllerParams->ControlPortBase); + ControllerIdx, ControllerParams->CommandPortBase); return FALSE; } @@ -967,6 +967,11 @@ IDECreateDevice(IN PDRIVER_OBJECT DriverObject, // Initialize the DPC object here IoInitializeDpcRequest(*DeviceObject, IDEDpcForIsr); + if (Win32Alias != NULL) + { + DbgPrint("%s is %s %dMB\n", DeviceName, Win32Alias, (Size + 512) / 1024); + } + return RC; } diff --git a/reactos/drivers/dd/ide/ide.h b/reactos/drivers/dd/ide/ide.h index cc6f1d6eba9..185be55dde0 100644 --- a/reactos/drivers/dd/ide/ide.h +++ b/reactos/drivers/dd/ide/ide.h @@ -30,11 +30,14 @@ extern "C" { #define IDE_RESET_BUSY_TIMEOUT 31 #define IDE_RESET_DRDY_TIMEOUT 120 -#define IDE_REG_ALT_STATUS 0x0006 -#define IDE_REG_DEV_CNTRL 0x0006 /* device control register */ +// Control Block offsets and masks +#define IDE_REG_ALT_STATUS 0x0000 +#define IDE_REG_DEV_CNTRL 0x0000 /* device control register */ #define IDE_DC_SRST 0x04 /* drive reset (both drives) */ #define IDE_DC_nIEN 0x02 /* IRQ enable (active low) */ -#define IDE_REG_DRV_ADDR 0x0007 +#define IDE_REG_DRV_ADDR 0x0001 + +// Command Block offsets and masks #define IDE_REG_DATA_PORT 0x0000 #define IDE_REG_ERROR 0x0001 /* error register */ #define IDE_ER_AMNF 0x01 /* addr mark not found */ diff --git a/reactos/iface/native/genntdll.c b/reactos/iface/native/genntdll.c index 74c055e4c95..6309bbe96b1 100644 --- a/reactos/iface/native/genntdll.c +++ b/reactos/iface/native/genntdll.c @@ -56,10 +56,17 @@ int process(FILE* in, FILE* out, FILE *out2) nr_args = (char *)strtok(NULL," \t"); // printf("name %s value %d\n",name,value); +#ifdef PARAMETERIZED_LIBS fprintf(out,"GLOBAL _%s@%s\n",name,nr_args); fprintf(out,"GLOBAL _%s@%s\n",name2,nr_args); fprintf(out,"_%s@%s:\n",name,nr_args); fprintf(out,"_%s@%s:\n",name2,nr_args); +#else + fprintf(out,"GLOBAL _%s\n",name); + fprintf(out,"GLOBAL _%s\n",name2); + fprintf(out,"_%s:\n",name); + fprintf(out,"_%s:\n",name2); +#endif fprintf(out,"\tmov\teax,%d\n",value); fprintf(out,"\tlea\tedx,[esp+4]\n"); fprintf(out,"\tint\t2Eh\n"); diff --git a/reactos/iface/native/sysfuncs.lst b/reactos/iface/native/sysfuncs.lst index 88dcb4b96bf..89dbd4c9e7f 100644 --- a/reactos/iface/native/sysfuncs.lst +++ b/reactos/iface/native/sysfuncs.lst @@ -208,4 +208,22 @@ NtReplyWaitSendChannel ZwReplyWaitSendChannel 12 NtSendWaitReplyChannel ZwSendWaitReplyChannel 16 NtSetContextChannel ZwSetContextChannel 4 NtYieldExecution ZwYieldExecution 0 +wcscat Rtlwcscat 8 +wcschr Rtlwcschr 8 +wcscmp Rtlwcscmp 8 +wcscpy Rtlwcscpy 8 +wcscspn Rtlwcscspn 8 +wcsicmp Rtlwcsicmp 8 +wcslen Rtlwcslen 4 +wcsncat Rtlwcsncat 12 +wcsncmp Rtlwcsncmp 12 +wcsncpy Rtlwcsncpy 12 +wcsnicmp Rtlwcsnicmp 12 +wcsnlen Rtlwcsnlen 8 +wcspbrk Rtlwcspbrk 8 +wcsrchr Rtlwcsrchr 8 +wcsspn Rtlwcsspn 8 +wcsstr Rtlwcsstr 8 +wcstok Rtlwcstok 8 +wstrlen Rtlwstrlen 4 diff --git a/reactos/include/ddk/li.h b/reactos/include/ddk/li.h new file mode 100644 index 00000000000..43080508444 --- /dev/null +++ b/reactos/include/ddk/li.h @@ -0,0 +1,20 @@ + +#ifdef COMPILER_LARGE_INTEGERS + +#define GET_LARGE_INTEGER_HIGH_PART(LargeInteger) ( ( LargeInteger >> 32) ) +#define GET_LARGE_INTEGER_LOW_PART(LargeInteger) ( (LargeInteger & 0xFFFFFFFF) ) +#define SET_LARGE_INTEGER_HIGH_PART(LargeInteger,Signed_Long) \ + ( LargeInteger |= ( ((LARGE_INTEGER)Signed_Long) << 32 ) ) +#define SET_LARGE_INTEGER_LOW_PART(LargeInteger,Unsigned_Long) \ + ( LargeInteger |= Unsigned_Long ) + +#else +#define GET_LARGE_INTEGER_HIGH_PART(LargeInteger) ( (LargeInteger.HighPart) ) +#define GET_LARGE_INTEGER_LOW_PART(LargeInteger) ( (LargeInteger.LowPart) ) +#define SET_LARGE_INTEGER_HIGH_PART(LargeInteger,Signed_Long) \ + ( LargeInteger.HighPart= Signed_Long ) +#define SET_LARGE_INTEGER_LOW_PART(LargeInteger,Unsigned_Long) \ + ( LargeInteger.LowPart = Unsigned_Long ) + +#endif + diff --git a/reactos/include/wstring.h b/reactos/include/wstring.h index 016f6f88067..a1c8524007d 100644 --- a/reactos/include/wstring.h +++ b/reactos/include/wstring.h @@ -20,14 +20,14 @@ typedef unsigned short wchar_t; extern "C" { #endif -//wchar_t * ___wcstok = NULL; +extern wchar_t * ___wcstok; extern wchar_t * wcscpy(wchar_t *,const wchar_t *); extern wchar_t * wcsncpy(wchar_t *,const wchar_t *, __kernel_size_t); extern wchar_t * wcscat(wchar_t *, const wchar_t *); extern wchar_t * wcsncat(wchar_t *, const wchar_t *, __kernel_size_t); extern int wcscmp(const wchar_t *,const wchar_t *); extern int wcsncmp(const wchar_t *,const wchar_t *,__kernel_size_t); -wchar_t* wcschr(wchar_t* str, wchar_t ch); +wchar_t* wcschr(const wchar_t* str, wchar_t ch); extern wchar_t * wcsrchr(const wchar_t *,wchar_t); extern wchar_t * wcspbrk(const wchar_t *,const wchar_t *); extern wchar_t * wcstok(wchar_t *,const wchar_t *); @@ -35,11 +35,13 @@ extern wchar_t * wcsstr(const wchar_t *,const wchar_t *); extern size_t wcsnlen(const wchar_t * s, size_t count); extern int wcsicmp(const wchar_t* cs,const wchar_t * ct); extern int wcsnicmp(const wchar_t* cs,const wchar_t * ct, size_t count); +extern size_t wcscspn(const wchar_t *, const wchar_t *); +extern size_t wcslen(const wchar_t *); +extern size_t wcsspn(const wchar_t *, const wchar_t *); +extern unsigned long wstrlen(PWSTR); WCHAR wtoupper(WCHAR c); WCHAR wtolower(WCHAR c); - - #ifdef __cplusplus } diff --git a/reactos/lib/kernel32/misc/atom.c b/reactos/lib/kernel32/misc/atom.c index 809c2052ee8..b6d8064a03d 100644 --- a/reactos/lib/kernel32/misc/atom.c +++ b/reactos/lib/kernel32/misc/atom.c @@ -14,12 +14,7 @@ #include #include #include -#include - - - - - +// RJJ: (we dont have it) #include /* system global and local atom tables */ diff --git a/reactos/lib/ntdll/napi.asm b/reactos/lib/ntdll/napi.asm index 02dd46b8904..f7f69cf5623 100644 --- a/reactos/lib/ntdll/napi.asm +++ b/reactos/lib/ntdll/napi.asm @@ -3,6 +3,8 @@ SECTION .text +BITS 32 + GLOBAL _NtAcceptConnectPort GLOBAL _ZwAcceptConnectPort _NtAcceptConnectPort: @@ -1893,3 +1895,165 @@ _ZwYieldExecution: int 2Eh ret 0 +GLOBAL _wcscat +GLOBAL _Rtlwcscat +_wcscat: +_Rtlwcscat: + mov eax,210 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcschr +GLOBAL _Rtlwcschr +_wcschr: +_Rtlwcschr: + mov eax,211 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcscmp +GLOBAL _Rtlwcscmp +_wcscmp: +_Rtlwcscmp: + mov eax,212 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcscpy +GLOBAL _Rtlwcscpy +_wcscpy: +_Rtlwcscpy: + mov eax,213 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcscspn +GLOBAL _Rtlwcscspn +_wcscspn: +_Rtlwcscspn: + mov eax,214 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcsicmp +GLOBAL _Rtlwcsicmp +_wcsicmp: +_Rtlwcsicmp: + mov eax,215 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcslen +GLOBAL _Rtlwcslen +_wcslen: +_Rtlwcslen: + mov eax,216 + lea edx,[esp+4] + int 2Eh + ret 4 + +GLOBAL _wcsncat +GLOBAL _Rtlwcsncat +_wcsncat: +_Rtlwcsncat: + mov eax,217 + lea edx,[esp+4] + int 2Eh + ret 12 + +GLOBAL _wcsncmp +GLOBAL _Rtlwcsncmp +_wcsncmp: +_Rtlwcsncmp: + mov eax,218 + lea edx,[esp+4] + int 2Eh + ret 12 + +GLOBAL _wcsncpy +GLOBAL _Rtlwcsncpy +_wcsncpy: +_Rtlwcsncpy: + mov eax,219 + lea edx,[esp+4] + int 2Eh + ret 12 + +GLOBAL _wcsnicmp +GLOBAL _Rtlwcsnicmp +_wcsnicmp: +_Rtlwcsnicmp: + mov eax,220 + lea edx,[esp+4] + int 2Eh + ret 12 + +GLOBAL _wcsnlen +GLOBAL _Rtlwcsnlen +_wcsnlen: +_Rtlwcsnlen: + mov eax,221 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcspbrk +GLOBAL _Rtlwcspbrk +_wcspbrk: +_Rtlwcspbrk: + mov eax,222 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcsrchr +GLOBAL _Rtlwcsrchr +_wcsrchr: +_Rtlwcsrchr: + mov eax,223 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcsspn +GLOBAL _Rtlwcsspn +_wcsspn: +_Rtlwcsspn: + mov eax,224 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcsstr +GLOBAL _Rtlwcsstr +_wcsstr: +_Rtlwcsstr: + mov eax,225 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wcstok +GLOBAL _Rtlwcstok +_wcstok: +_Rtlwcstok: + mov eax,226 + lea edx,[esp+4] + int 2Eh + ret 8 + +GLOBAL _wstrlen +GLOBAL _Rtlwstrlen +_wstrlen: +_Rtlwstrlen: + mov eax,227 + lea edx,[esp+4] + int 2Eh + ret 4 + diff --git a/reactos/ntoskrnl/ex/napi.c b/reactos/ntoskrnl/ex/napi.c index 1d64fa3cbf2..e67471b7105 100644 --- a/reactos/ntoskrnl/ex/napi.c +++ b/reactos/ntoskrnl/ex/napi.c @@ -9,7 +9,7 @@ /* INCLUDES *****************************************************************/ #include - +#include #include /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/hal/x86/printk.c b/reactos/ntoskrnl/hal/x86/printk.c index 51985268f32..d74c05ec469 100644 --- a/reactos/ntoskrnl/hal/x86/printk.c +++ b/reactos/ntoskrnl/hal/x86/printk.c @@ -63,15 +63,14 @@ * PURPOSE: Current cursor position */ static unsigned int cursorx=0, cursory=0; - static unsigned int lines_seen = 0; +static unsigned char CharAttribute = 0x17; //#define NR_ROWS 25 #define NR_ROWS 50 #define NR_COLUMNS 80 #define VIDMEM_BASE 0xb8000 - /* * PURPOSE: Points to the base of text mode video memory */ @@ -185,19 +184,19 @@ static void putchar(char c) { case '\n': cursory++; - cursorx=0; + cursorx = 0; lines_seen++; break; default: - vidmem[(cursorx*2) + (cursory*80*2)]=c; - vidmem[(cursorx*2) + (cursory*80*2)+1]=0x17; + vidmem[(cursorx * 2) + (cursory * 80 * 2)] = c; + vidmem[(cursorx * 2) + (cursory * 80 * 2) + 1] = CharAttribute; cursorx++; - if (cursorx>=NR_COLUMNS) + if (cursorx >= NR_COLUMNS) { cursory++; lines_seen++; - cursorx=0; + cursorx = 0; } } @@ -207,10 +206,10 @@ static void putchar(char c) char str[] = "--- press escape to continue"; lines_seen = 0; - for (i=0;str[i]!=0;i++) + for (i = 0; str[i] != 0; i++) { - vidmem[NR_COLUMNS*(NR_ROWS-1)*2+i*2]=str[i]; - vidmem[NR_COLUMNS*(NR_ROWS-1)*2+i*2+1]=0x37; // 17 for white on blue 37 + vidmem[NR_COLUMNS*(NR_ROWS-1)*2+i*2] = str[i]; + vidmem[NR_COLUMNS*(NR_ROWS-1)*2+i*2+1] = CharAttribute; } while (inb_p(0x60)!=0x81); @@ -218,26 +217,33 @@ static void putchar(char c) } #endif - if (cursory>=NR_ROWS) - { - memcpy(vidmem,&vidmem[NR_COLUMNS*2], - NR_COLUMNS*(NR_ROWS-1)*2); - memset(&vidmem[NR_COLUMNS*(NR_ROWS-1)*2],0,NR_COLUMNS*2); - cursory=NR_ROWS-1; - } + if (cursory >= NR_ROWS) + { + unsigned short *LinePtr; + + memcpy(vidmem, + &vidmem[NR_COLUMNS * 2], + NR_COLUMNS * (NR_ROWS - 1) * 2); + LinePtr = (unsigned short *) &vidmem[NR_COLUMNS * (NR_ROWS - 1) * 2]; + for (i = 0; i < NR_COLUMNS; i++) + { + LinePtr[i] = CharAttribute << 8; + } + cursory = NR_ROWS - 1; + } /* * Set the cursor position */ - offset=cursory*NR_COLUMNS; - offset=offset+cursorx; + offset = cursory * NR_COLUMNS; + offset = offset + cursorx; - outb_p(CRTC_COMMAND,CRTC_CURLO); - outb_p(CRTC_DATA,offset); - outb_p(CRTC_COMMAND,CRTC_CURHI); - offset>>=8; - outb_p(CRTC_DATA,offset); + outb_p(CRTC_COMMAND, CRTC_CURLO); + outb_p(CRTC_DATA, offset); + outb_p(CRTC_COMMAND, CRTC_CURHI); + offset >>= 8; + outb_p(CRTC_DATA, offset); } diff --git a/reactos/ntoskrnl/io/irp.c b/reactos/ntoskrnl/io/irp.c index 7283c7a6bf3..85ce6245f76 100644 --- a/reactos/ntoskrnl/io/irp.c +++ b/reactos/ntoskrnl/io/irp.c @@ -33,7 +33,7 @@ #include #include -//#define NDEBUG +#define NDEBUG #include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/rtl/wstring.c b/reactos/ntoskrnl/rtl/wstring.c index e6cb3b1a298..ea228fa73d9 100644 --- a/reactos/ntoskrnl/rtl/wstring.c +++ b/reactos/ntoskrnl/rtl/wstring.c @@ -6,6 +6,7 @@ * PROGRAMMER: David Welch (welch@mcmail.com) * UPDATE HISTORY: * Created 22/05/98 + * 1998/12/04 RJJ Cleaned up and added i386 def checks */ /* INCLUDES *****************************************************************/ @@ -15,73 +16,54 @@ #include +wchar_t * ___wcstok = NULL; + /* FUNCTIONS *****************************************************************/ -wchar_t * wcsncat(wchar_t * dest,const wchar_t * src,size_t count) +wchar_t * +wcscat(wchar_t *dest, const wchar_t *src) { - int i,j; + int i, j; - for (j=0;dest[j]!=0;j++); - for (i=0;i0;len--) - { - if (str[len-1]==ch) - { - return((wchar_t*)&str[len-1]); - } - } - return(NULL); + while (*cs != '\0' && *ct != '\0' && *cs == *ct) + { + cs++; + ct++; + } + return *cs - *ct; } -wchar_t* wcschr(wchar_t* str, wchar_t ch) -{ - while ((*str)!=((wchar_t)0)) - { - if ((*str)==ch) - { - return(str); - } - str++; - } - return(NULL); -} - -wchar_t * wcscpy(wchar_t * str1,const wchar_t * str2) +wchar_t * +wcscpy(wchar_t *str1, const wchar_t *str2) { while ( (*str1)==(*str2) ) { @@ -95,587 +77,504 @@ wchar_t * wcscpy(wchar_t * str1,const wchar_t * str2) return(wchar_t *)( (*str1) - (*str2) ); } +#ifdef i386 + +size_t +wcscspn(const wchar_t *cs, const wchar_t *ct) +{ + register wchar_t * __res; + __asm__ __volatile__( + "cld\n\t" + "movl %4,%%edi\n\t" + "repne\n\t" + "scasw\n\t" + "notl %%ecx\n\t" + "decl %%ecx\n\t" + "movl %%ecx,%%edx\n" + "1:\tlodsw\n\t" + "testw %%eax,%%eax\n\t" + "je 2f\n\t" + "movl %4,%%edi\n\t" + "movl %%edx,%%ecx\n\t" + "repne\n\t" + "scasw\n\t" + "jne 1b\n" + "2:\tdecl %0" + : "=S" (__res) + : "a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) + : "eax","ecx","edx","edi"); + + return __res-cs; +} + +#else + +size_t +wcscspn(const wchar_t *cs, const wchar_t *ct) +{ +UNIMPLEMENTED; +} + +#endif + +#ifdef i386 + +int +wcsicmp(const wchar_t *cs,const wchar_t *ct) +{ + register int __res; + + __asm__ __volatile__( + "cld\n" + "1:\tmovw (%%esi), %%eax\n\t" + "movw (%%edi), %%edx \n\t" + "cmpw $0x5A, %%eax\n\t" + "ja 2f\t\n" + "cmpw $0x40, %%eax\t\n" + "jbe 2f\t\n" + "addw $0x20, %%eax\t\n" + "2:\t cmpw $0x5A, %%edx\t\n" + "ja 3f\t\n" + "cmpw $0x40, %%edx\t\n" + "jbe 3f\t\n" + "addw $0x20, %%edx\t\n" + "3:\t inc %%esi\t\n" + "inc %%esi\t\n" + "inc %%edi\t\n" + "inc %%edi\t\n" + "cmpw %%eax, %%edx\t\n" + "jne 4f\n\t" + "cmpw $00, %%eax\n\t" + "jne 1b\n\t" + "xorl %%eax,%%eax\n\t" + "jmp 5f\n" + "4:\tsbbl %%eax,%%eax\n\t" + "orw $1,%%eax\n" + "5:" + : "=a" (__res) + : "S" (cs),"D" (ct) + : "esi","edi"); + + return __res; +} + +#else + +int +wcsicmp(const wchar_t *cs,const wchar_t *ct) +{ +UNIMPLEMENTED; +} + +#endif + +size_t +wcslen(const wchar_t *s) +{ + unsigned int len = 0; + + while (s[len] != 0) + { + len++; + } + + return len; +} + +wchar_t * +wcsncat(wchar_t *dest, const wchar_t *src, size_t count) +{ + int i, j; + + for (j = 0; dest[j] != 0; j++) + ; + for (i = 0; i < count; i++) + { + dest[j + i] = src[i]; + if (src[i] == 0) + { + return dest; + } + } + dest[j + i] = 0; + + return dest; +} + +#ifdef i386 + +int +wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count) +{ + register int __res; + + __asm__ __volatile__( + "cld\n" + "1:\tdecl %3\n\t" + "js 2f\n\t" + "lodsw\n\t" + "scasw\n\t" + "jne 3f\n\t" + "testw %%eax,%%eax\n\t" + "jne 1b\n" + "2:\txorl %%eax,%%eax\n\t" + "jmp 4f\n" + "3:\tsbbl %%eax,%%eax\n\t" + "orw $1,%%eax\n" + "4:" + : "=a" (__res) + : "S" (cs), "D" (ct), "c" (count) + : "esi","edi","ecx"); + + return __res; +} + +#else + +int +wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count) +{ +UNIMPLEMENTED; +} + +#endif + +wchar_t * +wcsncpy(wchar_t *dest, const wchar_t *src, size_t count) +{ + int i; + + for (i = 0; i < count; i++) + { + dest[i] = src[i]; + if (src[i] == 0) + { + return dest; + } + } + dest[i] = 0; + + return dest; +} + +#ifdef i386 + +int +wcsnicmp(const wchar_t *cs,const wchar_t *ct, size_t count) +{ + register int __res; + + __asm__ __volatile__( + "cld\n" + "1:\t decl %3\n\t" + "js 6f\n\t" + "movw (%%esi), %%eax\n\t" + "movw (%%edi), %%edx \n\t" + "cmpw $0x5A, %%eax\n\t" + "ja 2f\t\n" + "cmpw $0x40, %%eax\t\n" + "jbe 2f\t\n" + "addw $0x20, %%eax\t\n" + "2:\t cmpw $0x5A, %%edx\t\n" + "ja 3f\t\n" + "cmpw $0x40, %%edx\t\n" + "jbe 3f\t\n" + "addw $0x20, %%edx\t\n" + "3:\t inc %%esi\t\n" + "inc %%esi\t\n" + "inc %%edi\t\n" + "inc %%edi\t\n" + "cmpw %%eax, %%edx\t\n" + "jne 4f\n\t" + "cmpw $00, %%eax\n\t" + "jne 1b\n\t" + "6:xorl %%eax,%%eax\n\t" + "jmp 5f\n" + "4:\tsbbl %%eax,%%eax\n\t" + "orw $1,%%eax\n" + "5:" + : "=a" (__res) + : "S" (cs), "D" (ct), "c" (count) + : "esi", "edi", "ecx"); + + return __res; +} + +#else + +int +wcsnicmp(const wchar_t *cs,const wchar_t *ct, size_t count) +{ +UNIMPLEMENTED; +} + +#endif + +#ifdef i386 + +size_t +wcsnlen(const wchar_t *s, size_t count) +{ + register int __res; + __asm__ __volatile__( + "movl %1,%0\n\t" + "jmp 2f\n" + "1:\tcmpw $0,(%0)\n\t" + "je 3f\n\t" + "incl %0\n" + "2:\tdecl %2\n\t" + "cmpl $-1,%2\n\t" + "jne 1b\n" + "3:\tsubl %1,%0" + : "=a" (__res) + : "c" (s), "d" (count) + : "edx"); + + return __res; +} + +#else + +size_t +wcsnlen(const wchar_t *s, size_t count) +{ +UNIMPLEMENTED; +} + +#endif + +#ifdef i386 + +wchar_t * +wcspbrk(const wchar_t *cs, const wchar_t *ct) +{ + register wchar_t * __res; + __asm__ __volatile__( + "cld\n\t" + "movl %4,%%edi\n\t" + "repne\n\t" + "scasw\n\t" + "notl %%ecx\n\t" + "decl %%ecx\n\t" + "movl %%ecx,%%edx\n" + "1:\tlodsw\n\t" + "testw %%eax,%%eax\n\t" + "je 2f\n\t" + "movl %4,%%edi\n\t" + "movl %%edx,%%ecx\n\t" + "repne\n\t" + "scasw\n\t" + "jne 1b\n\t" + "decl %0\n\t" + "jmp 3f\n" + "2:\txorl %0,%0\n" + "3:" + : "=S" (__res) + : "a" (0), "c" (0xffffffff), "0" (cs), "g" (ct) + : "eax", "ecx", "edx", "edi"); + + return __res; +} + +#else + +wchar_t * +wcspbrk(const wchar_t *cs, const wchar_t *ct) +{ +UNIMPLEMENTED; +} + +#endif + +wchar_t * +wcsrchr(const wchar_t *str, wchar_t ch) +{ + unsigned int len = 0; + while (str[len] != ((wchar_t)0)) + { + len++; + } + + for (; len > 0; len--) + { + if (str[len-1]==ch) + { + return (wchar_t *) &str[len - 1]; + } + } + + return NULL; +} + +#ifdef i386 + +size_t +wcsspn(const wchar_t *cs, const wchar_t *ct) +{ + register wchar_t * __res; + + __asm__ __volatile__( + "cld\n\t" + "movl %4,%%edi\n\t" + "repne\n\t" + "scasw\n\t" + "notl %%ecx\n\t" + "decl %%ecx\n\t" + "movl %%ecx,%%edx\n" + "1:\tlodsw\n\t" + "testw %%eax,%%eax\n\t" + "je 2f\n\t" + "movl %4,%%edi\n\t" + "movl %%edx,%%ecx\n\t" + "repne\n\t" + "scasb\n\t" + "je 1b\n" + "2:\tdecl %0" + : "=S" (__res) + : "a" (0), "c" (0xffffffff), "0" (cs), "g" (ct) + : "eax", "ecx", "edx", "edi"); + + return __res-cs; +} + +#else + +size_t +wcsspn(const wchar_t *cs, const wchar_t *ct) +{ +UNIMPLEMENTED; +} + +#endif + +#ifdef i386 + +wchar_t * +wcsstr(const wchar_t *cs, const wchar_t *ct) +{ + register wchar_t * __res; + + __asm__ __volatile__( + "cld\n\t" \ + "movl %4,%%edi\n\t" + "repne\n\t" + "scasw\n\t" + "notl %%ecx\n\t" + "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ + "movl %%ecx,%%edx\n" + "1:\tmovl %4,%%edi\n\t" + "movl %%esi,%%eax\n\t" + "movl %%edx,%%ecx\n\t" + "repe\n\t" + "cmpsw\n\t" + "je 2f\n\t" /* also works for empty string, see above */ + "xchgl %%eax,%%esi\n\t" + "incl %%esi\n\t" + "cmpw $0,-1(%%eax)\n\t" + "jne 1b\n\t" + "xorl %%eax,%%eax\n\t" + "2:" + : "=a" (__res) + : "0" (0), "c" (0xffffffff), "S" (cs), "g" (ct) + : "ecx", "edx", "edi", "esi"); + + return __res; +} + +#else + +wchar_t * +wcsstr(const wchar_t *cs, const wchar_t *ct) +{ +UNIMPLEMENTED; +} + +#endif unsigned long wstrlen(PWSTR s) { return wcslen(s); } -#ifndef __MACHINE_STRING_FUNCTIONS +#ifdef i386 -size_t wcslen(const wchar_t * s) +wchar_t * +wcstok(wchar_t * s,const wchar_t * ct) { - - unsigned int len=0; + register wchar_t * __res; - while(s[len]!=0) { - len++; - }; - return len; -} -#else -size_t wcslen(const wchar_t * s) -{ -register int __res; -__asm__ __volatile__( - "cld\n\t" - "repne\n\t" - "scasw\n\t" - "notl %0\n\t" - "decl %0" - :"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"edi"); -return __res; -} -#endif + __asm__ __volatile__( + "testl %1,%1\n\t" + "jne 1f\n\t" + "testl %0,%0\n\t" + "je 8f\n\t" + "movl %0,%1\n" + "1:\txorl %0,%0\n\t" + "movl $-1,%%ecx\n\t" + "xorl %%eax,%%eax\n\t" + "cld\n\t" + "movl %4,%%edi\n\t" + "repnz\n\t" + "scasw\n\t" + "notl %%ecx\n\t" + "decl %%ecx\n\t" + "decl %%ecx\n\t" + "je 7f\n\t" /* empty delimiter-string */ + "movl %%ecx,%%edx\n" + "2:\tlodsw\n\t" + "testw %%eax,%%eax\n\t" + "je 7f\n\t" + "movl %4,%%edi\n\t" + "movl %%edx,%%ecx\n\t" + "repne\n\t" + "scasw\n\t" + "je 2b\n\t" + "decl %1\n\t" + "decl %1\n\t" + "cmpw $0,(%1)\n\t" + "je 7f\n\t" + "movl %1,%0\n" + "3:\tlodsw\n\t" + "testw %%eax,%%eax\n\t" + "je 5f\n\t" + "movl %4,%%edi\n\t" + "movl %%edx,%%ecx\n\t" + "repne\n\t" + "scasw\n\t" + "jne 3b\n\t" + "decl %1\n\t" + "decl %1\n\t" + "decl %1\n\t" + "decl %1\n\t" + "cmpw $0,(%1)\n\t" + "je 5f\n\t" + "movw $0,(%1)\n\t" + "incl %1\n\t" + "incl %1\n\t" + "jmp 6f\n" + "5:\txorl %1,%1\n" + "6:\tcmpw $0,(%0)\n\t" + "jne 7f\n\t" + "xorl %0,%0\n" + "7:\ttestl %0,%0\n\t" + "jne 8f\n\t" + "movl %0,%1\n" + "8:" + : "=b" (__res), "=S" (___wcstok) + : "0" (___wcstok), "1" (s), "g" (ct) + : "eax", "ecx", "edx", "edi", "memory"); -inline int wcscmp(const wchar_t* cs,const wchar_t * ct) -{ -register int __res; -__asm__ __volatile__( - "cld\n" - "1:\tlodsw\n\t" - "scasw\n\t" - "jne 2f\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "jmp 3f\n" - "2:\tsbbl %%eax,%%eax\n\t" - "orw $1,%%eax\n" - "3:" - :"=a" (__res):"S" (cs),"D" (ct):"esi","edi"); -return __res; + return __res; } -int wcsicmp(const wchar_t* cs,const wchar_t * ct) -{ -register int __res; - - -__asm__ __volatile__( - "cld\n" - "1:\tmovw (%%esi), %%eax\n\t" - "movw (%%edi), %%edx \n\t" - "cmpw $0x5A, %%eax\n\t" - "ja 2f\t\n" - "cmpw $0x40, %%eax\t\n" - "jbe 2f\t\n" - "addw $0x20, %%eax\t\n" - "2:\t cmpw $0x5A, %%edx\t\n" - "ja 3f\t\n" - "cmpw $0x40, %%edx\t\n" - "jbe 3f\t\n" - "addw $0x20, %%edx\t\n" - "3:\t inc %%esi\t\n" - "inc %%esi\t\n" - "inc %%edi\t\n" - "inc %%edi\t\n" - "cmpw %%eax, %%edx\t\n" - "jne 4f\n\t" - "cmpw $00, %%eax\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "jmp 5f\n" - "4:\tsbbl %%eax,%%eax\n\t" - "orw $1,%%eax\n" - "5:" - :"=a" (__res):"S" (cs),"D" (ct):"esi","edi"); - -return __res; -} - -wchar_t * wcscat(wchar_t * dest,const wchar_t * src) -{ -__asm__ __volatile__( - "cld\n\t" - "repnz\n\t" - "scasw\n\t" - "decl %1\n" - "decl %1\n\t" - "1:\tlodsw\n\t" - "stosw\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b" - : // no output - :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"esi","edi","eax","ecx"); -return dest; -} - - - - - -#ifdef __MACHINE_STRING_FUNCTIONS -/* - * Include machine specific inline routines - */ -//#ifndef _I386_STRING_H_ -//#define _I386_STRING_H_ - -/* - * On a 486 or Pentium, we are better off not using the - * byte string operations. But on a 386 or a PPro the - * byte string ops are faster than doing it by hand - * (MUCH faster on a Pentium). - * - * Also, the byte strings actually work correctly. Forget - * the i486 routines for now as they may be broken.. - */ - -#if FIXED_486_STRING && (CPU == 486 || CPU == 586) - #include #else -/* - * This string-include defines all string functions as inline - * functions. Use gcc. It also assumes ds=es=data space, this should be - * normal. Most of the string-functions are rather heavily hand-optimized, - * see especially wcstok,wcsstr,wcs[c]spn. They should work, but are not - * very easy to understand. Everything is done entirely within the register - * set, making the functions fast and clean. String instructions have been - * used through-out, making for "slightly" unclear code :-) - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - - - -#define __HAVE_ARCH_WCSCPY -extern inline wchar_t * wcscpy(wchar_t * dest,const wchar_t *src) +wchar_t * +wcstok(wchar_t * s,const wchar_t * ct) { -__asm__ __volatile__( - "cld\n" - "1:\tlodsw\n\t" - "stosw\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b" - : /* no output */ - :"S" (src),"D" (dest):"esi","edi","eax","memory"); -return dest; -} - -#define __HAVE_ARCH_WCSNCPY -inline wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count) -{ -__asm__ __volatile__( - "cld\n" - "1:\tdecl %2\n\t" - "js 2f\n\t" - "lodsw\n\t" - "stosw\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b\n\t" - "rep\n\t" - "stosw\n" - "2:" - : /* no output */ - :"S" (src),"D" (dest),"c" (count):"esi","edi","eax","ecx","memory"); -return dest; -} -/* -#define __HAVE_ARCH_WCSCAT -inline wchar_t * wcscat(wchar_t * dest,const wchar_t * src) -{ -__asm__ __volatile__( - "cld\n\t" - "repnz\n\t" - "scasw\n\t" - "decl %1\n" - "decl %1\n\t" - "1:\tlodsw\n\t" - "stosw\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b" - : // no output - :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"esi","edi","eax","ecx"); -return dest; -} -*/ -#define __HAVE_ARCH_WCSNCAT -inline wchar_t * wcsncat(wchar_t * dest,const wchar_t * src,size_t count) -{ -__asm__ __volatile__( - "cld\n\t" - "repnz\n\t" - "scasw\n\t" - "decl %1\n\t" - "movl %4,%3\n" - "decl %1\n\t" - "1:\tdecl %3\n\t" - "js 2f\n\t" - "lodsw\n\t" - "stosw\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b\n" - "2:\txorl %2,%2\n\t" - "stosw" - : /* no output */ - :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff),"g" (count) - :"esi","edi","eax","ecx","memory"); -return dest; -} - -#define __HAVE_ARCH_WCSCMP - -#define __HAVE_ARCH_WCSNCMP -inline int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count) -{ -register int __res; -__asm__ __volatile__( - "cld\n" - "1:\tdecl %3\n\t" - "js 2f\n\t" - "lodsw\n\t" - "scasw\n\t" - "jne 3f\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b\n" - "2:\txorl %%eax,%%eax\n\t" - "jmp 4f\n" - "3:\tsbbl %%eax,%%eax\n\t" - "orw $1,%%eax\n" - "4:" - :"=a" (__res):"S" (cs),"D" (ct),"c" (count):"esi","edi","ecx"); -return __res; -} - -#define __HAVE_ARCH_WCSCHR -inline wchar_t * wcschr(const wchar_t * s, int c) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" - "movw %%eax,%%edx\n" - "1:\tlodsw\n\t" - "cmpw %%edx,%%eax\n\t" - "je 2f\n\t" - "testw %%eax,%%eax\n\t" - "jne 1b\n\t" - "movl $1,%1\n" - "2:\tmovl %1,%0\n\t" - "decl %0\n\t" - "decl %0\n\t" - :"=a" (__res):"S" (s),"0" (c):"esi"); -return __res; -} - -#define __HAVE_ARCH_WCSRCHR -inline wchar_t * wcsrchr(const wchar_t * s, int c) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" - "movw %%eax,%%edx\n" - "1:\tlodsw\n\t" - "cmpw %%edx,%%eax\n\t" - "jne 2f\n\t" - "leal -2(%%esi),%0\n" - "2:\ttestw %%eax,%%eax\n\t" - "jne 1b" - :"=d" (__res):"0" (0),"S" (s),"a" (c):"eax","esi"); -return __res; -} - -#define __HAVE_ARCH_WCSSPN -inline size_t wcsspn(const wchar_t * cs, const wchar_t * ct) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasw\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsw\n\t" - "testw %%eax,%%eax\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "je 1b\n" - "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"eax","ecx","edx","edi"); -return __res-cs; -} - -#define __HAVE_ARCH_WCSCSPN -inline size_t wcscspn(const wchar_t * cs, const wchar_t * ct) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasw\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsw\n\t" - "testw %%eax,%%eax\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasw\n\t" - "jne 1b\n" - "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"eax","ecx","edx","edi"); -return __res-cs; -} - -#define __HAVE_ARCH_STRPBRK -inline wchar_t * wcspbrk(const wchar_t * cs,const wchar_t * ct) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasw\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsw\n\t" - "testw %%eax,%%eax\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasw\n\t" - "jne 1b\n\t" - "decl %0\n\t" - "jmp 3f\n" - "2:\txorl %0,%0\n" - "3:" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"eax","ecx","edx","edi"); -return __res; -} - -#define __HAVE_ARCH_WCSSTR -inline wchar_t * wcsstr(const wchar_t * cs,const wchar_t * ct) -{ -register wchar_t * __res; -__asm__ __volatile__( - "cld\n\t" \ - "movl %4,%%edi\n\t" - "repne\n\t" - "scasw\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ - "movl %%ecx,%%edx\n" - "1:\tmovl %4,%%edi\n\t" - "movl %%esi,%%eax\n\t" - "movl %%edx,%%ecx\n\t" - "repe\n\t" - "cmpsw\n\t" - "je 2f\n\t" /* also works for empty string, see above */ - "xchgl %%eax,%%esi\n\t" - "incl %%esi\n\t" - "cmpw $0,-1(%%eax)\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "2:" - :"=a" (__res):"0" (0),"c" (0xffffffff),"S" (cs),"g" (ct) - :"ecx","edx","edi","esi"); -return __res; -} - -/* -#define __HAVE_ARCH_WCSLEN -inline size_t wcslen(const wchar_t * s) -{ -register int __res; -__asm__ __volatile__( - "cld\n\t" - "repne\n\t" - "scasw\n\t" - "notl %0\n\t" - "decl %0" - :"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"edi"); -return __res; -} - -*/ - -#define __HAVE_ARCH_WCSTOK - - -inline wchar_t * wcstok(wchar_t * s,const wchar_t * ct) -{ - -register wchar_t * __res; -__asm__ __volatile__( - "testl %1,%1\n\t" - "jne 1f\n\t" - "testl %0,%0\n\t" - "je 8f\n\t" - "movl %0,%1\n" - "1:\txorl %0,%0\n\t" - "movl $-1,%%ecx\n\t" - "xorl %%eax,%%eax\n\t" - "cld\n\t" - "movl %4,%%edi\n\t" - "repnz\n\t" - "scasw\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "decl %%ecx\n\t" - "je 7f\n\t" /* empty delimiter-string */ - "movl %%ecx,%%edx\n" - "2:\tlodsw\n\t" - "testw %%eax,%%eax\n\t" - "je 7f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasw\n\t" - "je 2b\n\t" - "decl %1\n\t" - "decl %1\n\t" - "cmpw $0,(%1)\n\t" - "je 7f\n\t" - "movl %1,%0\n" - "3:\tlodsw\n\t" - "testw %%eax,%%eax\n\t" - "je 5f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasw\n\t" - "jne 3b\n\t" - "decl %1\n\t" - "decl %1\n\t" - "decl %1\n\t" - "decl %1\n\t" - "cmpw $0,(%1)\n\t" - "je 5f\n\t" - "movw $0,(%1)\n\t" - "incl %1\n\t" - "incl %1\n\t" - "jmp 6f\n" - "5:\txorl %1,%1\n" - "6:\tcmpw $0,(%0)\n\t" - "jne 7f\n\t" - "xorl %0,%0\n" - "7:\ttestl %0,%0\n\t" - "jne 8f\n\t" - "movl %0,%1\n" - "8:" - :"=b" (__res),"=S" (___wcstok) - :"0" (___wcstok),"1" (s),"g" (ct) - :"eax","ecx","edx","edi","memory"); - -return __res; -} - - -#define __HAVE_ARCH_WCSNLEN -inline size_t wcsnlen(const wchar_t * s, size_t count) -{ -register int __res; -__asm__ __volatile__( - "movl %1,%0\n\t" - "jmp 2f\n" - "1:\tcmpw $0,(%0)\n\t" - "je 3f\n\t" - "incl %0\n" - "2:\tdecl %2\n\t" - "cmpl $-1,%2\n\t" - "jne 1b\n" - "3:\tsubl %1,%0" - :"=a" (__res) - :"c" (s),"d" (count) - :"edx"); -return __res; -} - - -/* -#define __HAVE_ARCH_WCSICMP -inline int wcsicmp(const wchar_t* cs,const wchar_t * ct) -{ -register int __res; - - -__asm__ __volatile__( - "cld\n" - "1:\tmovw (%%esi), %%eax\n\t" - "movw (%%edi), %%edx \n\t" - "cmpw $0x5A, %%eax\n\t" - "ja 2f\t\n" - "cmpw $0x40, %%eax\t\n" - "jbe 2f\t\n" - "addw $0x20, %%eax\t\n" - "2:\t cmpw $0x5A, %%edx\t\n" - "ja 3f\t\n" - "cmpw $0x40, %%edx\t\n" - "jbe 3f\t\n" - "addw $0x20, %%edx\t\n" - "3:\t inc %%esi\t\n" - "inc %%esi\t\n" - "inc %%edi\t\n" - "inc %%edi\t\n" - "cmpw %%eax, %%edx\t\n" - "jne 4f\n\t" - "cmpw $00, %%eax\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "jmp 5f\n" - "4:\tsbbl %%eax,%%eax\n\t" - "orw $1,%%eax\n" - "5:" - :"=a" (__res):"S" (cs),"D" (ct):"esi","edi"); - -return __res; -} - -*/ -#define __HAVE_ARCH_WCSNICMP -inline int wcsnicmp(const wchar_t* cs,const wchar_t * ct, size_t count) -{ -register int __res; - - -__asm__ __volatile__( - "cld\n" - "1:\t decl %3\n\t" - "js 6f\n\t" - "movw (%%esi), %%eax\n\t" - "movw (%%edi), %%edx \n\t" - "cmpw $0x5A, %%eax\n\t" - "ja 2f\t\n" - "cmpw $0x40, %%eax\t\n" - "jbe 2f\t\n" - "addw $0x20, %%eax\t\n" - "2:\t cmpw $0x5A, %%edx\t\n" - "ja 3f\t\n" - "cmpw $0x40, %%edx\t\n" - "jbe 3f\t\n" - "addw $0x20, %%edx\t\n" - "3:\t inc %%esi\t\n" - "inc %%esi\t\n" - "inc %%edi\t\n" - "inc %%edi\t\n" - "cmpw %%eax, %%edx\t\n" - "jne 4f\n\t" - "cmpw $00, %%eax\n\t" - "jne 1b\n\t" - "6:xorl %%eax,%%eax\n\t" - "jmp 5f\n" - "4:\tsbbl %%eax,%%eax\n\t" - "orw $1,%%eax\n" - "5:" - :"=a" (__res):"S" (cs),"D" (ct), "c" (count):"esi","edi", "ecx"); - - -return __res; +UNIMPLEMENTED; } #endif -#endif + +