Changeset 21901 for branches/gcc-kmk/src


Ignore:
Timestamp:
Dec 16, 2011, 12:50:20 PM (14 years ago)
Author:
dmik
Message:

Port XX2LX to GCC/kBuild.

Location:
branches/gcc-kmk/src/win32k
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/win32k/Makefile.kmk

    r21779 r21901  
    1111include $(PATH_SUB_CURRENT)/lib/Makefile.kmk
    1212
     13PROGRAMS        = xx2lx
     14xx2lx_TEMPLATE  = OdinCxx
     15xx2lx_INCS      = include
     16xx2lx_SOURCES   = \
     17    ldr/xx2lxmain.cpp \
     18    ldr/modulebase.cpp \
     19    pe2lx/pe2lx.cpp \
     20    elf2lx/elf2lx.cpp \
     21    misc/malloc.c \
     22    misc/avl.c \
     23    misc/smalloc_avl.c \
     24    misc/rmalloc_avl.c \
     25    misc/new.cpp \
     26    misc/stricmp.c \
     27    misc/vprintf.c
     28
    1329include $(FILE_KBUILD_SUB_FOOTER)
  • branches/gcc-kmk/src/win32k/include/ModuleBase.h

    r5093 r21901  
    5555 */
    5656#define printIPE(a) (ModuleBase::ulInfoLevel >= ModuleBase::Error ? \
    57                      ModuleBase::printf("\nerror(%d:"__FUNCTION__"): !Internal Processing Error!\n\t", __LINE__), \
     57                     ModuleBase::printf("\nerror(%d:%s): !Internal Processing Error!\n\t", __LINE__, __FUNCTION__), \
    5858                     ModuleBase::printf a,  \
    5959                     ModuleBase::printf("\n")  \
    6060                     : (void)0,(void)0,(void)0 )
    6161#define printErr(a) (ModuleBase::ulInfoLevel >= ModuleBase::Error ? \
    62                      ModuleBase::printf("error(%d:"__FUNCTION__"): ", __LINE__), \
     62                     ModuleBase::printf("error(%d:%s: ", __LINE__, __FUNCTION__), \
    6363                     ModuleBase::printf a  \
    6464                     : (void)0,(void)0 )
    6565#define printWar(a) (ModuleBase::ulInfoLevel >= ModuleBase::Warning ? \
    66                      ModuleBase::printf("warning("__FUNCTION__"): "), \
     66                     ModuleBase::printf("warning(%s): ", __FUNCTION__), \
    6767                     ModuleBase::printf a  \
    6868                     : (void)0,(void)0 )
  • branches/gcc-kmk/src/win32k/include/OS2KLDR.h

    r6229 r21901  
    3636
    3737/* ote_flags */
    38 #ifndef __EXE386__
     38#if !defined(__EXE386__) && !defined(_LXexe_h_)
    3939  #define OBJREAD       0x00000001L     /* Readable Object */
    4040  #define OBJWRITE      0x00000002L     /* Writeable Object */
     
    4747#endif
    4848#define OBJZEROFIL      0x00000100L     /* Object has zero-filled pages */
    49 #ifndef __EXE386__
     49#if !defined(__EXE386__) && !defined(_LXexe_h_)
    5050  #define OBJRESIDENT   0x00000200L     /* Object is resident */
    5151  #define OBJCONTIG     0x00000300L     /* Object is resident and contiguous */
  • branches/gcc-kmk/src/win32k/include/asmutils.h

    r2511 r21901  
    2929    extern int _System Int3(void);
    3030#else
     31#ifdef __GNUC__
     32    #define _Inline static inline
     33    #define __interrupt(n) ({ __asm__ __volatile__ ("int" #n "\n\tnop"); })
     34#else
    3135    #include <builtin.h>
     36#endif
    3237    #define Int3() __interrupt(3)
    3338#endif
  • branches/gcc-kmk/src/win32k/include/new.h

    r1678 r21901  
    1212#define _new_h_
    1313
     14#ifdef __IBMC__
    1415/* check for IBMCPP new.h */
    1516#ifdef __new_h
     
    2324    typedef  unsigned int size_t;
    2425#endif
     26#endif
     27
     28#ifdef __GNUC__
     29#include <stddef.h>
     30#endif
    2531
    2632#ifndef __DEBUG_ALLOC__
    2733/* The standard favourites */
    2834void *operator new(size_t size);
    29 void *operator new(size_t size, void *location);  /* stub */
     35void *operator new(size_t size, void *location) throw();    /* stub */
    3036
    31 void *operator new[](size_t size);                /* stub */
    32 void *operator new[](size_t size, void *location);/* stub */
     37void *operator new[](size_t size) throw();                  /* stub */
     38void *operator new[](size_t size, void *location) throw();  /* stub */
    3339
    3440void operator delete(void *location);
    35 void operator delete[](void *location);           /* stub */
     41void operator delete[](void *location) throw();             /* stub */
    3642#endif
    3743
  • branches/gcc-kmk/src/win32k/include/sprintf.h

    r1678 r21901  
    3131 */
    3232#undef va_start
     33#ifdef __GNUC__
     34#define __nextword(base) (((unsigned)(sizeof(base))+3U)&~(3U))
     35#endif
    3336#define va_start(ap, last) ap = ((va_list)SSToDS(&last)) + __nextword(last)
    3437
  • branches/gcc-kmk/src/win32k/include/vprintf.h

    r1678 r21901  
    3232 */
    3333#undef va_start
     34#ifdef __GNUC__
     35#define __nextword(base) (((unsigned)(sizeof(base))+3U)&~(3U))
     36#endif
    3437#define va_start(ap, last) ap = ((va_list)SSToDS(&last)) + __nextword(last)
    3538
  • branches/gcc-kmk/src/win32k/misc/avl.c

    r4164 r21901  
    3333#include "string.h"
    3434
     35#ifdef __GNUC__
     36#define _Inline static inline
     37#define __interrupt(n) ({ __asm__ __volatile__ ("int" #n "\n\tnop"); })
     38#else
    3539#include <builtin.h>
     40#endif
    3641#define assert(a) ((a) ? (void)0 : __interrupt(3))
    3742
  • branches/gcc-kmk/src/win32k/misc/new.cpp

    r4164 r21901  
    4242 * stub
    4343 */
    44 void *operator new(size_t size, void *location)
     44void *operator new(size_t size, void *location) throw()
    4545{
    4646    dprintf(("operator new(size,location) not implemented\n"));
     
    5252 * stub
    5353 */
    54 void *operator new[](size_t size)
     54void *operator new[](size_t size) throw()
    5555{
    5656    dprintf(("operator new[](size) not implemented\n"));
     
    6262 * stub
    6363 */
    64 void *operator new[](size_t size, void *location)
     64void *operator new[](size_t size, void *location) throw()
    6565{
    6666    dprintf(("operator new[](size,location) not implemented\n"));
     
    8282 * stub
    8383 */
    84 void operator delete[](void *location)
     84void operator delete[](void *location) throw()
    8585{
    8686    dprintf(("operator delete[](location) - not implemented\n"));
     
    106106 * stub
    107107 */
    108 void *operator new(size_t size, const char *filename, size_t lineno, void *location)
     108void *operator new(size_t size, const char *filename, size_t lineno, void *location) throw()
    109109{
    110110    dprintf(("operator new(size,location) not implemented\n"));
     
    116116 * stub
    117117 */
    118 void *operator new[](size_t size, const char *filename, size_t lineno)
     118void *operator new[](size_t size, const char *filename, size_t lineno) throw()
    119119{
    120120    dprintf(("operator new[](size) not implemented\n"));
     
    126126 * stub
    127127 */
    128 void *operator new[](size_t size, const char *filename, size_t lineno, void *location)
     128void *operator new[](size_t size, const char *filename, size_t lineno, void *location) throw()
    129129{
    130130    dprintf(("operator new[](size,location) not implemented\n"));
  • branches/gcc-kmk/src/win32k/misc/vprintf.c

    r5298 r21901  
    395395                    lValue = va_arg(args, signed long);
    396396                else if (chArgSize == 'h')
     397#ifdef __GNUC__
     398                    // shut up stupid warning and avoid stupid abort()
     399                    lValue = va_arg(args, int);
     400#else
    397401                    lValue = va_arg(args, signed short);
     402#endif
    398403                else
    399404                    lValue = va_arg(args, signed int);
  • branches/gcc-kmk/src/win32k/pe2lx/pe2lx.cpp

    r10394 r21901  
    19411941    static SMTE smte;
    19421942    static MTE  mte;
    1943     static     achPage[PAGESIZE];
     1943    static CHAR achPage[PAGESIZE];
    19441944    int         i;
    19451945    APIRET      rc;
     
    52245224        for (i = 0; i < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; i++)
    52255225        {
    5226             char *pszName;
     5226            const char *pszName;
    52275227
    52285228            switch (i)
Note: See TracChangeset for help on using the changeset viewer.