Thu Feb 16 18:57:31 1995 Alexandre Julliard (julliard@sunsite.unc.edu) * [if1632/call.S] Only save the lower 16-bits of SP and BP. * [if1632/callback.c] When calling to 16-bit code, restore DS from its previous value on entry to the 32-bit code, instead of from the code segment owner. * [if1632/relay.c] [include/stackframe.h] Use a structure to represent the 16-bit stack frame layout instead of hard-coded offsets. * [rc/Imakefile] Use y.tab.c for bison output file for compatibility with yacc. * [tools/build.c] Small optimization for calls to 32-bit code. Sun Feb 12 03:19:47 1995 Michael Veksler (s1678223@t2.technion.ac.il) * [tools/build.c] Fixed bug (inflicted by previous change) - SEGV on ZMAGIC file format. Sun Feb 11 20:00:00 1995 Göran Thyni (goran@norrsken.bildbasen.se) * [debugger/dbg.y] Remove unnecessary sym-table loading when stopped in 16-bit mode. * [include/segmem.h] [loader/selector.c] Added dynamic alloction of selectors. Fixed some problems with large programs SIGSEGV-ing while running out of selectors. * [include/segmem.h] [loader/selector.c] [if1632/callback.c] [memory/global.c] [memory/heap.c] [memory/linear.c] Use __AHSHIFT and __AHINCR instead of 3 and 8. Mon Feb 6 18:07:38 1995 Cameron Heide (heide@ee.ualberta.ca) * [misc/dos_fs.c] Better relative path handling when converting filenames between dos and unix, allowing '.' to be used in the Windows path. Startup working dir is now based on current working dir. Sat Feb 4 21:21:13 1995 Michael Veksler (s1678223@t2.technion.ac.il) * [if1632/relay.c] [include/dlls.h] [tools/build.c] Squeezed data structure that references internal dll's (mostly "struct dll_table_entry_s"). Caused 20% reduction in executable code size. Fri Feb 3 18:53:15 1995 Martin v. Loewis (loewis@marie) * [Imakefile] make wine.sym only when making emulator * [misc/file.c] OpenFile(): report as not implemented for WINELIB * [misc/winsock.c] Fix CONVERT_HOSTENT and friends for use with WINELIB * [rc/Imakefile][rc/rc.y][rc/parser.c] Rename rc.y to parser.y Use flex and bison on Sun * [toolkit/sup.c] CallWindowProc: fix parameter type * [windows/event.c] Commented #ifdef sparc
97 lines
2.4 KiB
C
97 lines
2.4 KiB
C
/* $Id: segmem.h,v 1.3 1993/07/04 04:04:21 root Exp root $
|
|
*/
|
|
/*
|
|
* Copyright Robert J. Amstadt, 1993
|
|
*/
|
|
#ifndef SEGMEM_H
|
|
#define SEGMEM_H
|
|
|
|
#include "wine.h"
|
|
|
|
#ifdef __linux__
|
|
#define HAVE_IPC
|
|
#include <sys/ipc.h>
|
|
#include <sys/shm.h>
|
|
#endif
|
|
|
|
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
|
#define HAVE_IPC
|
|
#include <sys/types.h>
|
|
#include <sys/ipc.h>
|
|
#include <sys/shm.h>
|
|
#define SHMSEG 32 /* XXX SEMMNI /usr/src/sys/conf/param.h */
|
|
#define SHM_RANGE_START 0x40000000
|
|
#endif
|
|
|
|
/*
|
|
* Array to track selector allocation.
|
|
*/
|
|
#define SELECTOR_ISFREE 0x8000
|
|
#define SELECTOR_IS32BIT 0x4000
|
|
#define SELECTOR_INDEXMASK 0x0fff
|
|
|
|
#define __AHSHIFT 3
|
|
#define __AHINCR (1 << __AHSHIFT)
|
|
|
|
extern unsigned short* SelectorMap;
|
|
|
|
#ifdef HAVE_IPC
|
|
#define SAFEMAKEPTR(s, o) ((void *)(((int) (s) << 16) | ((o) & 0xffff)))
|
|
#define FIXPTR(p) (p)
|
|
#else
|
|
#define SAFEMAKEPTR(s, o) \
|
|
((void*)(((int)SelectorMap[SelectorMap[(s)>>__AHSHIFT] & SELECTOR_INDEXMASK]\
|
|
<< (16 + __AHSHIFT)) | 0x70000 | ((o) & 0xffff)))
|
|
#define FIXPTR(p) SAFEMAKEPTR((unsigned long) (p) >> 16, (p))
|
|
#endif
|
|
|
|
#define MAKESELECTOR(fp) ((unsigned short) (fp >> (16 + __AHSHIFT)))
|
|
|
|
|
|
/*
|
|
* Structure to hold info about each selector we create.
|
|
*/
|
|
|
|
typedef struct segment_descriptor_s
|
|
{
|
|
void *base_addr; /* Pointer to segment in flat memory */
|
|
unsigned int length; /* Length of segment */
|
|
unsigned int flags; /* Segment flags (see neexe.h and below)*/
|
|
unsigned short selector; /* Selector used to access this segment */
|
|
unsigned short owner; /* Handle of owner program */
|
|
unsigned char type; /* DATA or CODE */
|
|
#ifdef HAVE_IPC
|
|
key_t shm_key; /* Shared memory key or -1 */
|
|
#endif
|
|
} SEGDESC;
|
|
|
|
extern int IPCCopySelector(int i_old, unsigned long new, int swap_type);
|
|
|
|
/*
|
|
* Additional flags
|
|
*/
|
|
#define NE_SEGFLAGS_MALLOCED 0x00010000 /* Memory allocated with malloc() */
|
|
|
|
/*
|
|
* Global memory flags
|
|
*/
|
|
#define GLOBAL_FLAGS_MOVEABLE 0x0002
|
|
#define GLOBAL_FLAGS_ZEROINIT 0x0040
|
|
#define GLOBAL_FLAGS_CODE 0x00010000
|
|
#define GLOBAL_FLAGS_EXECUTEONLY 0x00020000
|
|
#define GLOBAL_FLAGS_READONLY 0x00020000
|
|
|
|
#ifdef __ELF__
|
|
#define FIRST_SELECTOR 2
|
|
#define IS_16_BIT_ADDRESS(addr) \
|
|
(!(SelectorMap[(unsigned int)(addr) >> (16+__AHSHIFT)]& SELECTOR_IS32BIT))
|
|
#else
|
|
#define FIRST_SELECTOR 8
|
|
#define IS_16_BIT_ADDRESS(addr) \
|
|
((unsigned int)(addr) >= (((FIRST_SELECTOR << __AHSHIFT) | 7) << 16))
|
|
#endif
|
|
|
|
|
|
extern SEGDESC* Segments;
|
|
|
|
#endif /* SEGMEM_H */
|