mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed warnings and errors so ReactOS can be compiled with GCC 3.2.
Removed unused ntoskrnl/rtl/bitops.c svn path=/trunk/; revision=2908
This commit is contained in:
parent
b0188a2a7a
commit
9ee98eeca9
69 changed files with 218 additions and 365 deletions
|
@ -793,3 +793,4 @@ VOID
|
|||
#endif /* __INCLUDE_ACPI_TYPES_H */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: acpisys.c,v 1.4 2001/08/27 01:24:36 ekohl Exp $
|
||||
/* $Id: acpisys.c,v 1.5 2002/05/05 14:57:44 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS ACPI bus driver
|
||||
* FILE: acpi/ospm/acpisys.c
|
||||
|
@ -136,7 +136,7 @@ ACPIAddDevice(
|
|||
|
||||
DeviceExtension->Pdo = PhysicalDeviceObject;
|
||||
|
||||
DeviceExtension->Ldo =
|
||||
DeviceExtension->Common.Ldo =
|
||||
IoAttachDeviceToDeviceStack(Fdo, PhysicalDeviceObject);
|
||||
|
||||
DeviceExtension->State = dsStopped;
|
||||
|
@ -157,9 +157,9 @@ DriverEntry(
|
|||
{
|
||||
DbgPrint("Advanced Configuration and Power Interface Bus Driver\n");
|
||||
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ACPIDispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = ACPIPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = ACPIPowerControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH) ACPIDispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) ACPIPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = (PDRIVER_DISPATCH) ACPIPowerControl;
|
||||
DriverObject->DriverExtension->AddDevice = ACPIAddDevice;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: fdo.c,v 1.1 2001/08/23 17:32:04 chorns Exp $
|
||||
/* $Id: fdo.c,v 1.2 2002/05/05 14:57:45 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS ACPI bus driver
|
||||
* FILE: acpi/ospm/fdo.c
|
||||
|
@ -87,11 +87,11 @@ FdoQueryBusRelations(
|
|||
|
||||
Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
|
||||
|
||||
PdoDeviceExtension->DeviceObject = Device->Pdo;
|
||||
PdoDeviceExtension->Common.DeviceObject = Device->Pdo;
|
||||
|
||||
PdoDeviceExtension->DevicePowerState = PowerDeviceD0;
|
||||
PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0;
|
||||
|
||||
PdoDeviceExtension->Ldo = IoAttachDeviceToDeviceStack(
|
||||
PdoDeviceExtension->Common.Ldo = IoAttachDeviceToDeviceStack(
|
||||
DeviceObject,
|
||||
Device->Pdo);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct _COMMON_DEVICE_EXTENSION
|
|||
typedef struct _PDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
COMMON_DEVICE_EXTENSION;
|
||||
COMMON_DEVICE_EXTENSION Common;
|
||||
// Hardware IDs
|
||||
UNICODE_STRING HardwareIDs;
|
||||
// Compatible IDs
|
||||
|
@ -51,7 +51,7 @@ typedef struct _PDO_DEVICE_EXTENSION
|
|||
typedef struct _FDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
COMMON_DEVICE_EXTENSION;
|
||||
COMMON_DEVICE_EXTENSION Common;
|
||||
// Physical Device Object
|
||||
PDEVICE_OBJECT Pdo;
|
||||
// Current state of the driver
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: fdo.c,v 1.1 2001/09/16 13:18:24 chorns Exp $
|
||||
/* $Id: fdo.c,v 1.2 2002/05/05 14:57:45 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS PCI bus driver
|
||||
* FILE: fdo.c
|
||||
|
@ -195,11 +195,11 @@ FdoQueryBusRelations(
|
|||
|
||||
RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION));
|
||||
|
||||
PdoDeviceExtension->IsFDO = FALSE;
|
||||
PdoDeviceExtension->Common.IsFDO = FALSE;
|
||||
|
||||
PdoDeviceExtension->DeviceObject = Device->Pdo;
|
||||
PdoDeviceExtension->Common.DeviceObject = Device->Pdo;
|
||||
|
||||
PdoDeviceExtension->DevicePowerState = PowerDeviceD0;
|
||||
PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0;
|
||||
|
||||
/* FIXME: Get device properties (Hardware IDs, etc.) */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: pci.c,v 1.1 2001/09/16 13:18:24 chorns Exp $
|
||||
/* $Id: pci.c,v 1.2 2002/05/05 14:57:45 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS PCI Bus driver
|
||||
* FILE: pci.c
|
||||
|
@ -544,7 +544,7 @@ PciAddDevice(
|
|||
|
||||
RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
|
||||
|
||||
DeviceExtension->IsFDO = TRUE;
|
||||
DeviceExtension->Common.IsFDO = TRUE;
|
||||
|
||||
DeviceExtension->Ldo =
|
||||
IoAttachDeviceToDeviceStack(Fdo, PhysicalDeviceObject);
|
||||
|
@ -569,9 +569,9 @@ DriverEntry(
|
|||
{
|
||||
DbgPrint("Peripheral Component Interconnect Bus Driver\n");
|
||||
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PciDispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = PciPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = PciPowerControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH) PciDispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) PciPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = (PDRIVER_DISPATCH) PciPowerControl;
|
||||
DriverObject->DriverExtension->AddDevice = PciAddDevice;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: pci.h,v 1.1 2001/09/16 13:18:24 chorns Exp $ */
|
||||
/* $Id: pci.h,v 1.2 2002/05/05 14:57:45 chorns Exp $ */
|
||||
|
||||
#ifndef __PCI_H
|
||||
#define __PCI_H
|
||||
|
@ -52,7 +52,7 @@ typedef struct _COMMON_DEVICE_EXTENSION
|
|||
typedef struct _PDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
COMMON_DEVICE_EXTENSION;
|
||||
COMMON_DEVICE_EXTENSION Common;
|
||||
// Device ID
|
||||
UNICODE_STRING DeviceID;
|
||||
// Instance ID
|
||||
|
@ -71,7 +71,7 @@ typedef struct _PDO_DEVICE_EXTENSION
|
|||
typedef struct _FDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
COMMON_DEVICE_EXTENSION;
|
||||
COMMON_DEVICE_EXTENSION Common;
|
||||
// Physical Device Object
|
||||
PDEVICE_OBJECT Pdo;
|
||||
// Current state of the driver
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#define VGA_OR 16
|
||||
#define VGA_XOR 24
|
||||
|
||||
typedef struct { int quot, rem; } div_t;
|
||||
//This is in mingw standard headers
|
||||
//typedef struct { int quot, rem; } div_t;
|
||||
|
||||
int maskbit[640], y80[480], xconv[640], bit8[640], startmasks[8], endmasks[8];
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
#define VGA_OR 16
|
||||
#define VGA_XOR 24
|
||||
|
||||
typedef struct { int quot, rem; } div_t;
|
||||
//This is in mingw standard headers
|
||||
//typedef struct { int quot, rem; } div_t;
|
||||
|
||||
int maskbit[640], y80[480], xconv[640], bit8[640], startmasks[8], endmasks[8];
|
||||
|
||||
|
|
|
@ -113,3 +113,4 @@ HalpSetCmosData(PBUS_HANDLER BusHandler,
|
|||
#endif /* __INTERNAL_HAL_BUS_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Author: ariadne $
|
||||
* $Date: 1999/04/02 21:42:06 $
|
||||
* $Revision: 1.4 $
|
||||
* $Author: chorns $
|
||||
* $Date: 2002/05/05 14:57:38 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -108,7 +108,9 @@ extern int* __imp__sys_nerr;
|
|||
#define sys_nerr (*__imp__sys_nerr)
|
||||
|
||||
extern char** __imp__sys_errlist;
|
||||
#ifndef sys_errlist
|
||||
#define sys_errlist (__imp__sys_errlist)
|
||||
#endif
|
||||
|
||||
#else
|
||||
/* CRTDLL run time library */
|
||||
|
|
|
@ -19,7 +19,7 @@ unsigned int _mbbtombc(unsigned int c);
|
|||
unsigned int _mbctombb(unsigned int c);
|
||||
|
||||
unsigned char * _mbscat(unsigned char *dst, const unsigned char *src);
|
||||
unsigned char * _mbschr(const unsigned char *str, unsigned int c);
|
||||
unsigned char * _mbschr(unsigned char *str, unsigned char* c);
|
||||
int _mbscmp(const unsigned char *, const unsigned char *);
|
||||
int _mbscoll(const unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbscpy(unsigned char *, const unsigned char *);
|
||||
|
@ -62,7 +62,7 @@ unsigned char * _mbsset(unsigned char *, unsigned int);
|
|||
size_t _mbsspn(const unsigned char *, const unsigned char *);
|
||||
|
||||
unsigned char * _mbsstr(const unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbstok(unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbstok(unsigned char *, unsigned char *);
|
||||
|
||||
unsigned char * _mbslwr(unsigned char *str);
|
||||
unsigned char * _mbsupr(unsigned char *str);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: iotypes.h,v 1.36 2002/04/10 09:55:10 ekohl Exp $
|
||||
/* $Id: iotypes.h,v 1.37 2002/05/05 14:57:38 chorns Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -669,13 +669,6 @@ typedef struct _DEVICE_OBJECT
|
|||
PVOID Reserved;
|
||||
} DEVICE_OBJECT, *PDEVICE_OBJECT;
|
||||
|
||||
/*
|
||||
* Dispatch routine type declaration
|
||||
*/
|
||||
typedef NTSTATUS STDCALL
|
||||
(*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT*,
|
||||
IRP*);
|
||||
|
||||
|
||||
/*
|
||||
* Fast i/o routine type declaration
|
||||
|
@ -723,6 +716,13 @@ typedef struct _FAST_IO_DISPATCH {
|
|||
PFAST_IO_ROUTINE ReleaseForCcFlush;
|
||||
} FAST_IO_DISPATCH, *PFAST_IO_DISPATCH;
|
||||
|
||||
/*
|
||||
* Dispatch routine type declaration
|
||||
*/
|
||||
typedef NTSTATUS STDCALL
|
||||
(*PDRIVER_DISPATCH)(IN struct _DEVICE_OBJECT *DeviceObject,
|
||||
IN struct _IRP *Irp);
|
||||
|
||||
/*
|
||||
* Dispatch routine type declaration
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ntddk.h,v 1.28 2002/04/26 13:05:09 ekohl Exp $
|
||||
/* $Id: ntddk.h,v 1.29 2002/05/05 14:57:38 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -23,7 +23,14 @@ extern "C"
|
|||
|
||||
#define STATIC static
|
||||
|
||||
|
||||
#ifndef _GNU_H_WINDOWS_H
|
||||
/* NASTY HACK! Our msvcrt are messed up, causing msvcrt.dll to crash when
|
||||
* the headers are mixed with MinGW msvcrt headers. Not including stdlib.h
|
||||
* seems to correct this.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <ntos/types.h>
|
||||
#include <ntos/time.h>
|
||||
#include <ntos/cdrom.h>
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Author: ekohl $
|
||||
* $Date: 2001/10/04 16:05:41 $
|
||||
* $Revision: 1.4 $
|
||||
* $Author: chorns $
|
||||
* $Date: 2002/05/05 14:57:39 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -98,17 +98,20 @@ extern "C" {
|
|||
int* _errno(void);
|
||||
#define errno (*_errno())
|
||||
|
||||
unsigned long* __doserrno(void);
|
||||
int* __doserrno(void);
|
||||
#define _doserrno (*__doserrno())
|
||||
|
||||
/* One of the MSVCRTxx libraries */
|
||||
|
||||
extern int* __imp__sys_nerr;
|
||||
#ifndef sys_nerr
|
||||
#define sys_nerr (*__imp__sys_nerr)
|
||||
#endif
|
||||
|
||||
extern char** __imp__sys_errlist;
|
||||
#ifndef sys_errlist
|
||||
#define sys_errlist (__imp__sys_errlist)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -9,3 +9,4 @@ extern int ungot_char;
|
|||
#endif /* __MSVCRT_INTERNAL_CONSOLE_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -35,3 +35,4 @@ PTHREADDATA GetThreadData(void);
|
|||
#endif /* __MSVCRT_INTERNAL_TLS_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ unsigned int _mbbtombc(unsigned int c);
|
|||
unsigned int _mbctombb(unsigned int c);
|
||||
|
||||
unsigned char * _mbscat(unsigned char *dst, const unsigned char *src);
|
||||
unsigned char * _mbschr(const unsigned char *str, unsigned int c);
|
||||
unsigned char * _mbschr(unsigned char *str, unsigned char* c);
|
||||
int _mbscmp(const unsigned char *, const unsigned char *);
|
||||
int _mbscoll(const unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbscpy(unsigned char *, const unsigned char *);
|
||||
|
@ -62,7 +62,7 @@ unsigned char * _mbsset(unsigned char *, unsigned int);
|
|||
size_t _mbsspn(const unsigned char *, const unsigned char *);
|
||||
|
||||
unsigned char * _mbsstr(const unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbstok(unsigned char *, const unsigned char *);
|
||||
unsigned char * _mbstok(unsigned char *, unsigned char *);
|
||||
|
||||
unsigned char * _mbslwr(unsigned char *str);
|
||||
unsigned char * _mbsupr(unsigned char *str);
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Author: ekohl $
|
||||
* $Date: 2001/07/03 12:55:00 $
|
||||
* $Revision: 1.2 $
|
||||
* $Author: chorns $
|
||||
* $Date: 2002/05/05 14:57:39 $
|
||||
*
|
||||
*/
|
||||
/* Appropriated for Reactos Crtdll by Ariadne */
|
||||
|
@ -72,8 +72,10 @@ typedef char* va_list;
|
|||
* pack shorts and such into a smaller argument list. Fortunately a
|
||||
* neatly arranged version is available through the use of __builtin_next_arg.
|
||||
*/
|
||||
#ifndef va_start
|
||||
#define va_start(ap, pN) \
|
||||
((ap) = ((va_list) __builtin_next_arg(pN)))
|
||||
#endif
|
||||
#else
|
||||
/*
|
||||
* For a simple minded compiler this should work (it works in GNU too for
|
||||
|
@ -87,7 +89,9 @@ typedef char* va_list;
|
|||
/*
|
||||
* End processing of variable argument list. In this case we do nothing.
|
||||
*/
|
||||
#ifndef va_end
|
||||
#define va_end(ap) ((void)0)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -98,10 +102,13 @@ typedef char* va_list;
|
|||
* increasing the alignment requirement.
|
||||
*/
|
||||
|
||||
#ifndef va_arg
|
||||
#define va_arg(ap, t) \
|
||||
(((ap) = (ap) + __va_argsiz(t)), \
|
||||
*((t*) (void*) ((ap) - __va_argsiz(t))))
|
||||
#endif
|
||||
|
||||
#endif /* Not RC_INVOKED */
|
||||
|
||||
#endif /* not _STDARG_H_ */
|
||||
|
||||
|
|
|
@ -113,3 +113,4 @@ inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn(
|
|||
#define MESSAGE wine_dbg_printf
|
||||
|
||||
#endif /* __WINE_DEBUGTOOLS_H */
|
||||
|
||||
|
|
|
@ -109,3 +109,4 @@ RevertToSelf(VOID)
|
|||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -30,3 +30,4 @@ unsigned int _mbctokata( unsigned int c )
|
|||
{
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,3 +16,4 @@ int _ismbbalpha(unsigned char c)
|
|||
{
|
||||
return (isalpha(c) ||_ismbbkalnum(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,3 +7,4 @@ int _ismbbalnum(unsigned char c)
|
|||
{
|
||||
return (isalnum(c) || _ismbbkalnum(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -11,3 +11,4 @@ int _ismbbpunct(unsigned char c)
|
|||
// (0xA1 <= c <= 0xA6)
|
||||
return (ispunct(c) || _ismbbkana(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <crtdll/mbstring.h>
|
||||
|
||||
unsigned char * _mbstok(unsigned char *s, const unsigned char *delim)
|
||||
unsigned char * _mbstok(unsigned char *s, unsigned char *delim)
|
||||
{
|
||||
const char *spanp;
|
||||
int c, sc;
|
||||
|
|
|
@ -13,3 +13,4 @@ void *_lsearch(const void *key, void *base, size_t *nelp, size_t width,
|
|||
(*nelp)++;
|
||||
return base ;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,3 +33,4 @@ __vscanf (const char *format, va_list arg)
|
|||
return __vfscanf (stdin, format, arg);
|
||||
}
|
||||
//weak_alias (__vscanf, vscanf)
|
||||
|
||||
|
|
|
@ -55,3 +55,4 @@ __vsscanf (const char *s,const char *format,va_list arg)
|
|||
|
||||
|
||||
//weak_alias (__vsscanf, vsscanf)
|
||||
|
||||
|
|
|
@ -9,3 +9,4 @@ int mbtowc( wchar_t *wchar, const char *mbchar, size_t count )
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,3 +6,4 @@ char * _strspnp( const char * str1, const char * str2)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,3 +33,4 @@ wchar_t _towupper(wchar_t c)
|
|||
return(c);
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
|
@ -8,3 +8,4 @@ _XcptFilter(DWORD ExceptionCode,
|
|||
//fixme XcptFilter
|
||||
// return UnhandledExceptionFilter(ExceptionInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,3 +10,4 @@ double _copysign (double __d, double __s)
|
|||
|
||||
return __d;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,3 +9,4 @@ double _y0(double x)
|
|||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,3 +30,4 @@ unsigned int _mbctokata( unsigned int c )
|
|||
{
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,3 +14,4 @@ int _ismbbalpha(unsigned char c)
|
|||
{
|
||||
return (isalpha(c) || _ismbbkalnum(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -6,3 +6,4 @@ int _ismbbalnum(unsigned char c)
|
|||
{
|
||||
return (isalnum(c) || _ismbbkalnum(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -11,3 +11,4 @@ int _ismbbpunct(unsigned char c)
|
|||
// (0xA1 <= c <= 0xA6)
|
||||
return (ispunct(c) || _ismbbkana(c));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <msvcrt/mbstring.h>
|
||||
|
||||
unsigned char * _mbstok(unsigned char *s, const unsigned char *delim)
|
||||
unsigned char * _mbstok(unsigned char *s, unsigned char *delim)
|
||||
{
|
||||
const char *spanp;
|
||||
int c, sc;
|
||||
|
|
|
@ -48,3 +48,4 @@ unsigned char * _mbsupr(unsigned char *x)
|
|||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: dllmain.c,v 1.12 2002/04/28 22:37:00 hbirr Exp $
|
||||
/* $Id: dllmain.c,v 1.13 2002/05/05 14:57:41 chorns Exp $
|
||||
*
|
||||
* ReactOS MSVCRT.DLL Compatibility Library
|
||||
*/
|
||||
|
|
|
@ -98,3 +98,4 @@ PTHREADDATA GetThreadData(void)
|
|||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -16,3 +16,4 @@ void *_lfind(const void *key, const void *base, size_t *nelp,
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,3 +14,4 @@ void *_lsearch(const void *key, void *base, size_t *nelp, size_t width,
|
|||
(*nelp)++;
|
||||
return base;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,3 +31,4 @@ int __vscanf (const char *format, va_list arg)
|
|||
{
|
||||
return __vfscanf(stdin, format, arg);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,3 +47,4 @@ int __vsscanf(const char *s,const char *format,va_list arg)
|
|||
|
||||
return __vfscanf(&f, format, arg);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: errno.c,v 1.5 2001/10/04 16:06:36 ekohl Exp $
|
||||
/* $Id: errno.c,v 1.6 2002/05/05 14:57:42 chorns Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
|||
#include <msvcrt/internal/tls.h>
|
||||
#include <msvcrt/internal/file.h>
|
||||
|
||||
unsigned long *__doserrno(void)
|
||||
int* __doserrno(void)
|
||||
{
|
||||
return(&GetThreadData()->tdoserrno);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: dllmain.c,v 1.7 2000/06/29 23:35:28 dwelch Exp $
|
||||
/* $Id: dllmain.c,v 1.8 2002/05/05 14:57:42 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.67 2002/03/22 20:58:23 chorns Exp $
|
||||
# $Id: Makefile,v 1.68 2002/05/05 14:57:42 chorns Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -104,7 +104,6 @@ OBJECTS_RTL = \
|
|||
rtl/timezone.o \
|
||||
rtl/unicode.o \
|
||||
rtl/wstring.o \
|
||||
rtl/bitops.o \
|
||||
rtl/memcmp.o \
|
||||
rtl/capture.o
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: view.c,v 1.37 2002/02/08 02:57:06 chorns Exp $
|
||||
/* $Id: view.c,v 1.38 2002/05/05 14:57:42 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -62,6 +62,8 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
extern void * alloca(size_t);
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: registry.c,v 1.70 2002/03/16 19:57:26 ekohl Exp $
|
||||
/* $Id: registry.c,v 1.71 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -599,19 +599,19 @@ CmiInitHives(BOOLEAN SetUpBoot)
|
|||
|
||||
/* Connect the SOFTWARE hive */
|
||||
Status = CmiInitializeHive(SOFTWARE_REG_FILE, REG_SOFTWARE_KEY_NAME, "Software", CmiMachineKey, SetUpBoot);
|
||||
assert(NT_SUCCESS(Status));
|
||||
//assert(NT_SUCCESS(Status));
|
||||
|
||||
/* Connect the SAM hive */
|
||||
Status = CmiInitializeHive(SAM_REG_FILE,REG_SAM_KEY_NAME, "Sam", CmiMachineKey, SetUpBoot);
|
||||
assert(NT_SUCCESS(Status));
|
||||
//assert(NT_SUCCESS(Status));
|
||||
|
||||
/* Connect the SECURITY hive */
|
||||
Status = CmiInitializeHive(SEC_REG_FILE, REG_SEC_KEY_NAME, "Security", CmiMachineKey, SetUpBoot);
|
||||
assert(NT_SUCCESS(Status));
|
||||
//assert(NT_SUCCESS(Status));
|
||||
|
||||
/* Connect the DEFAULT hive */
|
||||
Status = CmiInitializeHive(USER_REG_FILE, REG_USER_KEY_NAME, ".Default", CmiUserKey, SetUpBoot);
|
||||
assert(NT_SUCCESS(Status));
|
||||
//assert(NT_SUCCESS(Status));
|
||||
|
||||
/* FIXME : initialize standards symbolic links */
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: kdb.c,v 1.5 2001/05/05 19:13:08 chorns Exp $
|
||||
/* $Id: kdb.c,v 1.6 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/dbg/kdb.c
|
||||
|
@ -94,7 +94,7 @@ struct
|
|||
* Ignores `locale' stuff. Assumes that the upper and lower case
|
||||
* alphabets and digits are each contiguous.
|
||||
*/
|
||||
static unsigned long
|
||||
unsigned long
|
||||
strtoul(const char *nptr, char **endptr, int base)
|
||||
{
|
||||
const char *s = nptr;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: arcname.c,v 1.2 2002/03/15 23:59:38 ekohl Exp $
|
||||
/* $Id: arcname.c,v 1.3 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: device.c,v 1.39 2002/04/19 20:27:20 ekohl Exp $
|
||||
/* $Id: device.c,v 1.40 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -273,7 +273,6 @@ IoRegisterDriverReinitialization(PDRIVER_OBJECT DriverObject,
|
|||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS STDCALL
|
||||
IopDefaultDispatchFunction(PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
|
@ -285,7 +284,6 @@ IopDefaultDispatchFunction(PDEVICE_OBJECT DeviceObject,
|
|||
return(STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
IopCreateDriverObject(PDRIVER_OBJECT *DriverObject)
|
||||
{
|
||||
|
@ -318,7 +316,7 @@ IopCreateDriverObject(PDRIVER_OBJECT *DriverObject)
|
|||
|
||||
for (i=0; i<=IRP_MJ_MAXIMUM_FUNCTION; i++)
|
||||
{
|
||||
Object->MajorFunction[i] = IopDefaultDispatchFunction;
|
||||
Object->MajorFunction[i] = (PDRIVER_DISPATCH) IopDefaultDispatchFunction;
|
||||
}
|
||||
|
||||
*DriverObject = Object;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: pnproot.c,v 1.6 2001/09/16 13:19:32 chorns Exp $
|
||||
/* $Id: pnproot.c,v 1.7 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -64,7 +64,7 @@ typedef struct _PNPROOT_COMMON_DEVICE_EXTENSION
|
|||
typedef struct _PNPROOT_PDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
PNPROOT_COMMON_DEVICE_EXTENSION;
|
||||
PNPROOT_COMMON_DEVICE_EXTENSION Common;
|
||||
// Device ID
|
||||
UNICODE_STRING DeviceID;
|
||||
// Instance ID
|
||||
|
@ -75,7 +75,7 @@ typedef struct _PNPROOT_PDO_DEVICE_EXTENSION
|
|||
typedef struct _PNPROOT_FDO_DEVICE_EXTENSION
|
||||
{
|
||||
// Common device data
|
||||
PNPROOT_COMMON_DEVICE_EXTENSION;
|
||||
PNPROOT_COMMON_DEVICE_EXTENSION Common;
|
||||
// Physical Device Object
|
||||
PDEVICE_OBJECT Pdo;
|
||||
// Lower device object
|
||||
|
@ -144,11 +144,11 @@ PnpRootCreateDevice(
|
|||
|
||||
RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION));
|
||||
|
||||
PdoDeviceExtension->IsFDO = FALSE;
|
||||
PdoDeviceExtension->Common.IsFDO = FALSE;
|
||||
|
||||
PdoDeviceExtension->DeviceObject = Device->Pdo;
|
||||
PdoDeviceExtension->Common.DeviceObject = Device->Pdo;
|
||||
|
||||
PdoDeviceExtension->DevicePowerState = PowerDeviceD0;
|
||||
PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0;
|
||||
|
||||
if (!IopCreateUnicodeString(
|
||||
&PdoDeviceExtension->DeviceID,
|
||||
|
@ -648,11 +648,11 @@ PnpRootQueryBusRelations(
|
|||
|
||||
RtlZeroMemory(PdoDeviceExtension, sizeof(PNPROOT_PDO_DEVICE_EXTENSION));
|
||||
|
||||
PdoDeviceExtension->IsFDO = FALSE;
|
||||
PdoDeviceExtension->Common.IsFDO = FALSE;
|
||||
|
||||
PdoDeviceExtension->DeviceObject = Device->Pdo;
|
||||
PdoDeviceExtension->Common.DeviceObject = Device->Pdo;
|
||||
|
||||
PdoDeviceExtension->DevicePowerState = PowerDeviceD0;
|
||||
PdoDeviceExtension->Common.DevicePowerState = PowerDeviceD0;
|
||||
|
||||
if (!IopCreateUnicodeString(
|
||||
&PdoDeviceExtension->DeviceID,
|
||||
|
@ -913,7 +913,7 @@ PnpRootAddDevice(
|
|||
|
||||
RtlZeroMemory(DeviceExtension, sizeof(PNPROOT_FDO_DEVICE_EXTENSION));
|
||||
|
||||
DeviceExtension->IsFDO = TRUE;
|
||||
DeviceExtension->Common.IsFDO = TRUE;
|
||||
|
||||
DeviceExtension->State = dsStopped;
|
||||
|
||||
|
@ -955,8 +955,8 @@ PnpRootDriverEntry(
|
|||
{
|
||||
DPRINT("Called\n");
|
||||
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = PnpRootPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = PnpRootPowerControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) PnpRootPnpControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_POWER] = (PDRIVER_DISPATCH) PnpRootPowerControl;
|
||||
DriverObject->DriverExtension->AddDevice = PnpRootAddDevice;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: xhaldisp.c,v 1.4 2001/06/08 15:11:04 ekohl Exp $
|
||||
/* $Id: xhaldisp.c,v 1.5 2002/05/05 14:57:43 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -20,18 +20,18 @@
|
|||
HAL_DISPATCH EXPORTED HalDispatchTable =
|
||||
{
|
||||
HAL_DISPATCH_VERSION,
|
||||
NULL, // HalQuerySystemInformation
|
||||
NULL, // HalSetSystemInformation
|
||||
NULL, // HalQueryBusSlots
|
||||
NULL, // HalDeviceControl
|
||||
xHalExamineMBR,
|
||||
xHalIoAssignDriveLetters,
|
||||
xHalIoReadPartitionTable,
|
||||
xHalIoSetPartitionInformation,
|
||||
xHalIoWritePartitionTable,
|
||||
NULL, // HalReferenceHandlerForBus
|
||||
NULL, // HalReferenceBusHandler
|
||||
NULL // HalDereferenceBusHandler
|
||||
(pHalQuerySystemInformation) NULL, // HalQuerySystemInformation
|
||||
(pHalSetSystemInformation) NULL, // HalSetSystemInformation
|
||||
(pHalQueryBusSlots) NULL, // HalQueryBusSlots
|
||||
(pHalDeviceControl) NULL, // HalDeviceControl
|
||||
(pHalExamineMBR) xHalExamineMBR,
|
||||
(pHalIoAssignDriveLetters) xHalIoAssignDriveLetters,
|
||||
(pHalIoReadPartitionTable) xHalIoReadPartitionTable,
|
||||
(pHalIoSetPartitionInformation) xHalIoSetPartitionInformation,
|
||||
(pHalIoWritePartitionTable) xHalIoWritePartitionTable,
|
||||
(pHalHandlerForBus) NULL, // HalReferenceHandlerForBus
|
||||
(pHalReferenceBusHandler) NULL, // HalReferenceBusHandler
|
||||
(pHalReferenceBusHandler) NULL // HalDereferenceBusHandler
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static CPU_REGISTER GspRegisters[NUMREGS] =
|
|||
{ 4, FIELD_OFFSET (KTRAP_FRAME_X86, Gs) }
|
||||
};
|
||||
|
||||
static CHAR GspThreadStates[THREAD_STATE_MAX] =
|
||||
static PCHAR GspThreadStates[THREAD_STATE_MAX] =
|
||||
{
|
||||
"Invalid", /* THREAD_STATE_INVALID */
|
||||
"Runnable", /* THREAD_STATE_RUNNABLE */
|
||||
|
@ -742,7 +742,7 @@ GspQuery(PCHAR Request)
|
|||
/* Get thread information */
|
||||
if (GspFindThread (ptr, &ThreadInfo))
|
||||
{
|
||||
PCHAR String = &GspThreadStates[ThreadInfo->Tcb.State];
|
||||
PCHAR String = GspThreadStates[ThreadInfo->Tcb.State];
|
||||
GspMem2Hex (String, &GspOutBuffer[0], strlen (String), FALSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -401,4 +401,3 @@ _irq_handler_15:
|
|||
popa
|
||||
iret
|
||||
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: main.c,v 1.120 2002/05/02 23:45:33 dwelch Exp $
|
||||
/* $Id: main.c,v 1.121 2002/05/05 14:57:44 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/main.c
|
||||
|
@ -202,7 +202,7 @@ VOID CreateDefaultRegistryForLegacyDriver(
|
|||
}
|
||||
#ifdef FULLREG
|
||||
DwordData = 0;
|
||||
Length = Length = sizeof(DWORD);
|
||||
Length = sizeof(DWORD);
|
||||
Status = RtlWriteRegistryValue(
|
||||
RTL_REGISTRY_HANDLE,
|
||||
(PWSTR)KeyHandle,
|
||||
|
|
|
@ -1,203 +0,0 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* Copyright 1992, Linus Torvalds.
|
||||
*/
|
||||
/*
|
||||
* These have to be done with inline assembly: that way the bit-setting
|
||||
* is guaranteed to be atomic. All bit operations return 0 if the bit
|
||||
* was cleared before the operation and != 0 if it was not.
|
||||
*
|
||||
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
||||
*/
|
||||
|
||||
#ifdef __SMP__
|
||||
#define LOCK_PREFIX "lock ; "
|
||||
#else
|
||||
#define LOCK_PREFIX ""
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes to keep gcc -Wall happy
|
||||
*/
|
||||
extern void set_bit(int nr, volatile void * addr);
|
||||
extern void clear_bit(int nr, volatile void * addr);
|
||||
extern void change_bit(int nr, volatile void * addr);
|
||||
extern int test_and_set_bit(int nr, volatile void * addr);
|
||||
extern int test_and_clear_bit(int nr, volatile void * addr);
|
||||
extern int test_and_change_bit(int nr, volatile void * addr);
|
||||
extern int __constant_test_bit(int nr, const volatile void * addr);
|
||||
extern int __test_bit(int nr, volatile void * addr);
|
||||
extern int find_first_zero_bit(void * addr, unsigned size);
|
||||
extern int find_next_zero_bit (void * addr, int size, int offset);
|
||||
extern unsigned long ffz(unsigned long word);
|
||||
|
||||
/*
|
||||
* Some hacks to defeat gcc over-optimizations..
|
||||
*/
|
||||
struct __dummy { unsigned long a[100]; };
|
||||
#define ADDR (*(volatile struct __dummy *) addr)
|
||||
#define CONST_ADDR (*(volatile const struct __dummy *) addr)
|
||||
|
||||
void set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
void clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
void change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %1,%0"
|
||||
:"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
}
|
||||
|
||||
int test_and_set_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btsl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
int test_and_clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btrl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
int test_and_change_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__( LOCK_PREFIX
|
||||
"btcl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit),"=m" (ADDR)
|
||||
:"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine doesn't need to be atomic.
|
||||
*/
|
||||
int __constant_test_bit(int nr, const volatile void * addr)
|
||||
{
|
||||
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
|
||||
}
|
||||
|
||||
int test_bit(int nr, volatile void * addr)
|
||||
{
|
||||
int oldbit;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"btl %2,%1\n\tsbbl %0,%0"
|
||||
:"=r" (oldbit)
|
||||
:"m" (ADDR),"Ir" (nr));
|
||||
return oldbit;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define test_bit(nr,addr) \
|
||||
(__builtin_constant_p(nr) ? \
|
||||
__constant_test_bit((nr),(addr)) : \
|
||||
__test_bit((nr),(addr)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find-bit routines..
|
||||
*/
|
||||
int find_first_zero_bit(void * addr, unsigned size)
|
||||
{
|
||||
int d0, d1, d2;
|
||||
int res;
|
||||
|
||||
if (!size)
|
||||
return 0;
|
||||
__asm__("cld\n\t"
|
||||
"movl $-1,%%eax\n\t"
|
||||
"xorl %%edx,%%edx\n\t"
|
||||
"repe; scasl\n\t"
|
||||
"je 1f\n\t"
|
||||
"xorl -4(%%edi),%%eax\n\t"
|
||||
"subl $4,%%edi\n\t"
|
||||
"bsfl %%eax,%%edx\n"
|
||||
"1:\tsubl %%ebx,%%edi\n\t"
|
||||
"shll $3,%%edi\n\t"
|
||||
"addl %%edi,%%edx"
|
||||
:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
|
||||
:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
|
||||
return res;
|
||||
}
|
||||
|
||||
int find_next_zero_bit (void * addr, int size, int offset)
|
||||
{
|
||||
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
|
||||
int set = 0, bit = offset & 31, res;
|
||||
|
||||
if (bit) {
|
||||
/*
|
||||
* Look for zero in first byte
|
||||
*/
|
||||
__asm__("bsfl %1,%0\n\t"
|
||||
"jne 1f\n\t"
|
||||
"movl $32, %0\n"
|
||||
"1:"
|
||||
: "=r" (set)
|
||||
: "r" (~(*p >> bit)));
|
||||
if (set < (32 - bit))
|
||||
return set + offset;
|
||||
set = 32 - bit;
|
||||
p++;
|
||||
}
|
||||
/*
|
||||
* No zero yet, search remaining full bytes for a zero
|
||||
*/
|
||||
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
|
||||
return (offset + set + res);
|
||||
}
|
||||
|
||||
/*
|
||||
* ffz = Find First Zero in word. Undefined if no zero exists,
|
||||
* so code should check against ~0UL first..
|
||||
*/
|
||||
unsigned long ffz(unsigned long word)
|
||||
{
|
||||
__asm__("bsfl %1,%0"
|
||||
:"=r" (word)
|
||||
:"r" (~word));
|
||||
return word;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: timezone.c,v 1.1 2001/06/01 17:13:24 ekohl Exp $
|
||||
/* $Id: timezone.c,v 1.2 2002/05/05 14:57:44 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
|
|
@ -20,8 +20,7 @@ endif
|
|||
#
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
NASM_FORMAT = win32
|
||||
#PREFIX = i586-mingw32-
|
||||
PREFIX = /usr/mingw32-2.95.3-fc/bin/mingw32-pc-
|
||||
PREFIX = i386-mingw32msv-
|
||||
EXE_POSTFIX :=
|
||||
EXE_PREFIX := ./
|
||||
DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
|
||||
|
@ -29,6 +28,7 @@ NASM_CMD = nasm
|
|||
DOSCLI =
|
||||
FLOPPY_DIR = /mnt/floppy
|
||||
SEP := /
|
||||
PIPE :=
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),mingw32-windows)
|
||||
|
@ -41,6 +41,7 @@ NASM_CMD = nasmw
|
|||
DOSCLI = yes
|
||||
FLOPPY_DIR = A:
|
||||
SEP := \$(EMPTY_VAR)
|
||||
PIPE := -pipe
|
||||
endif
|
||||
|
||||
|
||||
|
@ -79,7 +80,15 @@ MC = $(TOOLS_PATH)/wmc/wmc
|
|||
|
||||
|
||||
# Maybe we can delete these soon
|
||||
CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe -m386
|
||||
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -march=i386
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),mingw32-windows)
|
||||
CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe -march=i386
|
||||
endif
|
||||
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
NFLAGS = -i$(PATH_TO_TOP)/include/ -f$(NASM_FORMAT) -d$(NASM_FORMAT)
|
||||
ASFLAGS := $(ASFLAGS) -I$(PATH_TO_TOP)/include -D__ASM__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: helper.mk,v 1.12 2002/04/29 23:02:12 hyperion Exp $
|
||||
# $Id: helper.mk,v 1.13 2002/05/05 14:57:45 chorns Exp $
|
||||
#
|
||||
# Helper makefile for ReactOS modules
|
||||
# Variables this makefile accepts:
|
||||
|
@ -350,12 +350,12 @@ endif
|
|||
|
||||
ifeq ($(MK_MODE),user)
|
||||
MK_DEFBASE := 0x400000
|
||||
MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(MK_SDKLIBS) $(TARGET_SDKLIBS))
|
||||
MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(MK_SDKLIBS) $(TARGET_SDKLIBS)) $(TARGET_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(MK_MODE),kernel)
|
||||
MK_DEFBASE := 0x10000
|
||||
MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(MK_DDKLIBS) $(TARGET_DDKLIBS))
|
||||
MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(MK_DDKLIBS) $(TARGET_DDKLIBS)) $(TARGET_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
|
@ -374,17 +374,16 @@ endif
|
|||
#
|
||||
include $(PATH_TO_TOP)/config
|
||||
|
||||
|
||||
TARGET_CFLAGS += $(MK_CFLAGS)
|
||||
TARGET_CFLAGS += -pipe -march=$(ARCH)
|
||||
TARGET_CFLAGS += $(PIPE) -march=$(ARCH)
|
||||
|
||||
TARGET_CPPFLAGS += $(MK_CPPFLAGS)
|
||||
TARGET_CPPFLAGS += -pipe -march=$(ARCH)
|
||||
TARGET_CPPFLAGS += $(PIPE) -march=$(ARCH)
|
||||
|
||||
TARGET_RCFLAGS += $(MK_RCFLAGS)
|
||||
|
||||
TARGET_ASFLAGS += $(MK_ASFLAGS)
|
||||
TARGET_ASFLAGS += -pipe -march=$(ARCH)
|
||||
TARGET_ASFLAGS += $(PIPE) -march=$(ARCH)
|
||||
|
||||
TARGET_NFLAGS += $(MK_NFLAGS)
|
||||
|
||||
|
|
Loading…
Reference in a new issue