Changeset 21796 for branches/gcc-kmk/src


Ignore:
Timestamp:
Nov 8, 2011, 10:19:10 PM (14 years ago)
Author:
dmik
Message:

Define global DLL variables in KERNEL32 (shared segment) in a more portable way.

Location:
branches/gcc-kmk/src/kernel32
Files:
1 added
7 edited

Legend:

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

    r21786 r21796  
    136136    oslibwps.cpp \
    137137    _ras.cpp \
     138    globaldata.asm \
    138139    kernelrsrc.orc
    139140
     
    143144    dbgwrap.cpp \
    144145    kernel32dbg.def
     146
     147# This overcomes current emxomfld limitation wrt SEGMENTS in .DEF
     148kernel32_LDFLAGS    = -Zlinker '"SEGMENT _GLOBALDATA LOADONCALL READWRITE SHARED"'
    145149
    146150ifndef CUSTOMBUILD
  • branches/gcc-kmk/src/kernel32/heapshared.cpp

    r21714 r21796  
    3131#include "dbglocal.h"
    3232
    33 #define MAX_HEAPSIZE            (2048*1024)
     33#define MAX_HEAPSIZE        (2048*1024)
    3434#define MAX_HEAPPAGES           (MAX_HEAPSIZE/PAGE_SIZE)
    3535#define INCR_HEAPSIZE           (16*1024)
    3636
    37 //Global DLL Data
    38 #pragma data_seg(_GLOBALDATA)
    39        Heap_t  sharedHeap = 0;
    40 static PVOID   pSharedMem = NULL;
    41 static BYTE    pageBitmap[MAX_HEAPPAGES] = {0};
    42 static ULONG   refCount = 0;
    43 #pragma data_seg()
     37//
     38// Global DLL Data (keep it in sync with globaldata.asm!)
     39//
     40extern Heap_t  sharedHeap; // = 0
     41extern PVOID   pSharedMem; // = NULL
     42extern BYTE    pageBitmap[MAX_HEAPPAGES]; // = {0}
     43extern ULONG   refCount; // = 0;
    4444
    4545static int     privateRefCount = 0;
  • branches/gcc-kmk/src/kernel32/initterm.cpp

    r21734 r21796  
    6060extern PFN pfnImSetMsgQueueProperty;
    6161
    62 //Global DLL Data
    63 #pragma data_seg(_GLOBALDATA)
    64 int globLoadNr = 0;
    65 #pragma data_seg()
     62//
     63// Global DLL Data (keep it in sync with globaldata.asm!)
     64//
     65extern int globLoadNr; // = 0
    6666
    6767BOOL    fVersionWarp3 = FALSE;
  • branches/gcc-kmk/src/kernel32/kernel32.def

    r21793 r21796  
    88DESCRIPTION 'Odin32 System DLL - Kernel32'
    99
    10 SEGMENTS
    11 
    12    _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     10;
     11; Segments are done with LDFLAGS (emxomfld limitation)
     12;
     13; SEGMENTS
     14;
     15;   _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     16;
    1317
    1418IMPORTS
  • branches/gcc-kmk/src/kernel32/kernel32dbg.def

    r21793 r21796  
    88DESCRIPTION 'Odin32 System DLL - Kernel32'
    99
    10 SEGMENTS
    11 
    12    _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     10;
     11; Segments are done with LDFLAGS (emxomfld limitation)
     12;
     13; SEGMENTS
     14;
     15;   _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     16;
    1317
    1418IMPORTS
  • branches/gcc-kmk/src/kernel32/mmap.cpp

    r21732 r21796  
    4141#include "dbglocal.h"
    4242
    43 
    44 
    45 //Global DLL Data
    46 #pragma data_seg(_GLOBALDATA)
    47 Win32MemMap  *Win32MemMap::memmaps = NULL;
    48 CRITICAL_SECTION_OS2       globalmapcritsect = {0};
    49 #pragma data_seg()
    50 
    51 
    5243static LPCSTR pszMMapSemName = MEMMAP_CRITSECTION_NAME;
    5344
  • branches/gcc-kmk/src/kernel32/mmap.h

    r10376 r21796  
    284284//******************************************************************************
    285285
    286 #pragma data_seg(_GLOBALDATA)
     286//
     287// Global DLL Data (keep it in sync with globaldata.asm!)
     288//
    287289extern CRITICAL_SECTION_OS2 globalmapcritsect;
    288 #pragma data_seg()
    289290
    290291void InitializeMemMaps();
Note: See TracChangeset for help on using the changeset viewer.