Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6c8edaa6
Commit
6c8edaa6
authored
Dec 13, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use getpagesize() instead of VIRTUAL_GetPageSize().
parent
982a223f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
66 deletions
+14
-66
global.h
include/global.h
+1
-6
virtual.c
memory/virtual.c
+3
-47
cpu.c
misc/cpu.c
+3
-2
xms.c
msdos/xms.c
+1
-3
sysdeps.c
scheduler/sysdeps.c
+1
-3
device.c
win32/device.c
+5
-5
No files found.
include/global.h
View file @
6c8edaa6
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "wine/windef16.h"
#include "wine/library.h"
/* memory/global.c */
extern
HGLOBAL16
GLOBAL_CreateBlock
(
UINT16
flags
,
const
void
*
ptr
,
DWORD
size
,
...
...
@@ -18,12 +19,6 @@ extern BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, const void *ptr, DWORD size );
extern
HGLOBAL16
GLOBAL_Alloc
(
WORD
flags
,
DWORD
size
,
HGLOBAL16
hOwner
,
unsigned
char
selflags
);
/* memory/virtual.c */
extern
DWORD
VIRTUAL_GetPageSize
(
void
);
extern
DWORD
VIRTUAL_GetGranularity
(
void
);
extern
LPVOID
VIRTUAL_MapFileW
(
LPCWSTR
name
);
extern
LPVOID
VIRTUAL_mmap
(
int
unix_handle
,
LPVOID
start
,
DWORD
size
,
DWORD
offset
,
int
prot
,
int
flags
);
typedef
BOOL
(
*
HANDLERPROC
)(
LPVOID
,
LPCVOID
);
extern
BOOL
VIRTUAL_SetFaultHandler
(
LPCVOID
addr
,
HANDLERPROC
proc
,
LPVOID
arg
);
extern
DWORD
VIRTUAL_HandleFault
(
LPCVOID
addr
);
...
...
memory/virtual.c
View file @
6c8edaa6
...
...
@@ -103,6 +103,7 @@ static UINT page_size;
#define VIRTUAL_DEBUG_DUMP_VIEW(view) \
if (!TRACE_ON(virtual)); else VIRTUAL_DumpView(view)
static
LPVOID
VIRTUAL_mmap
(
int
fd
,
LPVOID
start
,
DWORD
size
,
DWORD
offset
,
int
prot
,
int
flags
);
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
...
...
@@ -592,24 +593,6 @@ DECL_GLOBAL_CONSTRUCTOR(VIRTUAL_Init)
/***********************************************************************
* VIRTUAL_GetPageSize
*/
DWORD
VIRTUAL_GetPageSize
(
void
)
{
return
1
<<
page_shift
;
}
/***********************************************************************
* VIRTUAL_GetGranularity
*/
DWORD
VIRTUAL_GetGranularity
(
void
)
{
return
granularity_mask
+
1
;
}
/***********************************************************************
* VIRTUAL_SetFaultHandler
*/
BOOL
VIRTUAL_SetFaultHandler
(
LPCVOID
addr
,
HANDLERPROC
proc
,
LPVOID
arg
)
...
...
@@ -661,8 +644,8 @@ DWORD VIRTUAL_HandleFault( LPCVOID addr )
* Wrapper for mmap() that handles anonymous mappings portably,
* and falls back to read if mmap of a file fails.
*/
LPVOID
VIRTUAL_mmap
(
int
fd
,
LPVOID
start
,
DWORD
size
,
DWORD
offset
,
int
prot
,
int
flags
)
static
LPVOID
VIRTUAL_mmap
(
int
fd
,
LPVOID
start
,
DWORD
size
,
DWORD
offset
,
int
prot
,
int
flags
)
{
int
pos
;
LPVOID
ret
;
...
...
@@ -1646,30 +1629,3 @@ BOOL WINAPI UnmapViewOfFile(
VIRTUAL_DeleteView
(
view
);
return
TRUE
;
}
/***********************************************************************
* VIRTUAL_MapFileW
*
* Helper function to map a file to memory:
* name - file name
* [RETURN] ptr - pointer to mapped file
*/
LPVOID
VIRTUAL_MapFileW
(
LPCWSTR
name
)
{
HANDLE
hFile
,
hMapping
;
LPVOID
ptr
=
NULL
;
hFile
=
CreateFileW
(
name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_RANDOM_ACCESS
,
0
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
hMapping
=
CreateFileMappingA
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
CloseHandle
(
hFile
);
if
(
hMapping
)
{
ptr
=
MapViewOfFile
(
hMapping
,
FILE_MAP_READ
,
0
,
0
,
0
);
CloseHandle
(
hMapping
);
}
}
return
ptr
;
}
misc/cpu.c
View file @
6c8edaa6
...
...
@@ -8,9 +8,10 @@
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include "config.h"
#include "wine/port.h"
#include "winbase.h"
#include "winreg.h"
#include "global.h"
#include "winnt.h"
#include "winerror.h"
#include "debugtools.h"
...
...
@@ -55,7 +56,7 @@ VOID WINAPI GetSystemInfo(
* FIXME: perhaps overrideable with precompiler flags?
*/
cachedsi
.
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_INTEL
;
cachedsi
.
dwPageSize
=
VIRTUAL_GetPageS
ize
();
cachedsi
.
dwPageSize
=
getpages
ize
();
/* FIXME: the two entries below should be computed somehow... */
cachedsi
.
lpMinimumApplicationAddress
=
(
void
*
)
0x00010000
;
...
...
msdos/xms.c
View file @
6c8edaa6
...
...
@@ -10,12 +10,10 @@
#include <string.h>
#include "winbase.h"
#include "wine/winbase16.h"
#include "global.h"
#include "module.h"
#include "miscemu.h"
#include "toolhelp.h"
#include "debugtools.h"
#include "selectors.h"
DEFAULT_DEBUG_CHANNEL
(
int31
);
...
...
@@ -58,7 +56,7 @@ void WINAPI XMS_Handler( CONTEXT86 *context )
mmi
.
dwSize
=
sizeof
(
mmi
);
MemManInfo16
(
&
mmi
);
AX_reg
(
context
)
=
mmi
.
dwLargestFreeBlock
>>
10
;
DX_reg
(
context
)
=
(
mmi
.
dwFreePages
*
VIRTUAL_GetPageSize
()
)
>>
10
;
DX_reg
(
context
)
=
(
mmi
.
dwFreePages
*
mmi
.
wPageSize
)
>>
10
;
TRACE
(
"returning largest %dK, total %dK
\n
"
,
AX_reg
(
context
),
DX_reg
(
context
));
}
break
;
...
...
scheduler/sysdeps.c
View file @
6c8edaa6
...
...
@@ -29,10 +29,8 @@ static int *ph_errno = &h_errno;
#endif
#include "wine/port.h"
#include "thread.h"
#include "selectors.h"
#include "server.h"
#include "winbase.h"
#include "global.h"
#include "wine/exception.h"
#include "debugtools.h"
...
...
@@ -282,7 +280,7 @@ static LPVOID SYSDEPS_LargeStackLow = NULL;
void
SYSDEPS_SwitchToThreadStack
(
void
(
*
func
)(
void
)
)
{
DWORD
page_size
=
VIRTUAL_GetPageS
ize
();
DWORD
page_size
=
getpages
ize
();
DWORD
cur_stack
=
(((
DWORD
)
&
func
)
+
(
page_size
-
1
))
&
~
(
page_size
-
1
);
TEB
*
teb
=
NtCurrentTeb
();
...
...
win32/device.c
View file @
6c8edaa6
...
...
@@ -22,6 +22,7 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
#include "wine/port.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
...
...
@@ -35,7 +36,6 @@
#include "stackframe.h"
#include "server.h"
#include "debugtools.h"
#include "global.h"
DEFAULT_DEBUG_CHANNEL
(
win32
);
...
...
@@ -678,7 +678,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context )
{
LPVOID
address
;
LPVOID
ret
;
DWORD
psize
=
VIRTUAL_GetPageS
ize
();
DWORD
psize
=
getpages
ize
();
ULONG
page
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
npages
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
flags
=
(
ULONG
)
stack32_pop
(
context
);
...
...
@@ -708,7 +708,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context )
LPVOID
address
;
LPVOID
ret
;
DWORD
virt_perm
;
DWORD
psize
=
VIRTUAL_GetPageS
ize
();
DWORD
psize
=
getpages
ize
();
ULONG
page
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
npages
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
hpd
=
(
ULONG
)
stack32_pop
(
context
);
...
...
@@ -737,7 +737,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context )
{
LPVOID
address
;
BOOL
ret
;
DWORD
psize
=
VIRTUAL_GetPageS
ize
();
DWORD
psize
=
getpages
ize
();
ULONG
page
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
npages
=
(
ULONG
)
stack32_pop
(
context
);
ULONG
flags
=
(
ULONG
)
stack32_pop
(
context
);
...
...
@@ -757,7 +757,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context )
DWORD
virt_new_perm
;
MEMORY_BASIC_INFORMATION
mbi
;
LPVOID
address
;
DWORD
psize
=
VIRTUAL_GetPageS
ize
();
DWORD
psize
=
getpages
ize
();
ULONG
page
=
stack32_pop
(
context
);
ULONG
npages
=
stack32_pop
(
context
);
ULONG
permand
=
stack32_pop
(
context
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment