VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Makefile.kmk@ 78608

Last change on this file since 78608 was 78608, checked in by vboxsync, 6 years ago

winnt/vboxsf: Don't flush and purge the cache twice on newer systems, instead do a library trick to redirect relevant imports from write.obj and read.obj to our wrappers that uses CcCoherencyFlushAndPurgeCache when possible to get better coherency between mmap regions and file content when writing and reading normally. This comes at a cost when the file has been mmapped at some point previously (or currently) and we may need to purge stuff. bugref:9172

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1# $Id: Makefile.kmk 78608 2019-05-20 23:04:08Z vboxsync $
2## @file
3# Sub-Makefile for the VirtualBox Windows Guest Shared Folders FSD.
4#
5
6#
7# Copyright (C) 2006-2019 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# VBoxSF
23#
24SYSMODS += VBoxSF
25VBoxSF_TEMPLATE = VBOXGUESTR0
26VBoxSF_DEFS = LOG_TO_BACKDOOR VBOX_WITH_HGCM IN_RING0
27#VBoxSF_DEFS += LOG_ENABLED
28
29VBoxSF_SDKS.x86 = ReorderCompilerIncs $(VBOX_WINDDK_GST_W2K3)
30VBoxSF_SDKS.amd64 = ReorderCompilerIncs $(VBOX_WINDDK_GST_WLH)
31
32VBoxSF_LDFLAGS.x86 = -Entry:DriverEntry@8
33VBoxSF_LDFLAGS.amd64 = -Entry:DriverEntry
34VBoxSF_SOURCES = \
35 vbsf.cpp \
36 net.cpp \
37 file.cpp \
38 info.cpp \
39 path.cpp \
40 vbsfhlp.cpp \
41 VBoxSF.rc
42VBoxSF_SOURCES.x86 = \
43 Win2kWorkarounds.c \
44 Win2kWorkaroundsA.asm
45
46VBoxSF_LIBS.x86 = \
47 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/rxce.lib \
48 $(VBoxSF_0_OUTDIR)/rdbsslib.lib \
49 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/copysup.lib \
50 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ntoskrnl.lib \
51 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/hal.lib \
52 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/ksecdd.lib \
53 $(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.x86)/BufferOverflowK.lib
54
55VBoxSF_LIBS.amd64 = \
56 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/rxce.lib \
57 $(VBoxSF_0_OUTDIR)/rdbsslib.lib \
58 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/copysup.lib \
59 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/ntoskrnl.lib \
60 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/hal.lib \
61 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/ksecdd.lib \
62 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.amd64)/BufferOverflowK.lib
63
64VBoxSF_LIBS = \
65 $(VBOX_LIB_VBGL_R0) \
66 $(VBOX_LIB_IPRT_GUEST_R0)
67
68VBoxSF_CLEAN = \
69 $(VBoxSF_0_OUTDIR)/rdbsslib.lib
70
71
72include $(FILE_KBUILD_SUB_FOOTER)
73
74ifeq ($(KBUILD_TARGET_ARCH),x86)
75$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_W2K3)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
76 $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" \
77 --select "write.obj" \
78 --redefine-sym "__imp__CcFlushCache@16=_g_pfnWrFlushCache" \
79 --redefine-sym "__imp__CcPurgeCacheSection@16=_g_pfnWrPurgeCacheSection" \
80 --select "read.obj" \
81 --redefine-sym "__imp__CcFlushCache@16=_g_pfnRdFlushCache"
82else
83$(VBoxSF_0_OUTDIR)/rdbsslib.lib: $$(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB.$(KBUILD_TARGET_ARCH))/rdbsslib.lib | $$(dir $$@) $(VBOX_EDIT_COFF_LIB)
84 $(VBOX_EDIT_COFF_LIB) --input "$<" --output "$@" -v -v -v -v -v -v \
85 --select "write.obj" \
86 --redefine-sym "__imp_CcFlushCache=g_pfnWrFlushCache" \
87 --redefine-sym "__imp_CcPurgeCacheSection=g_pfnWrPurgeCacheSection" \
88 --select "read.obj" \
89 --redefine-sym "__imp_CcFlushCache=g_pfnRdFlushCache"
90endif
91
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette