From 33a5d68ad77e0c333f8b13f8281896d72ba9ee47 Mon Sep 17 00:00:00 2001 From: Andy <550896603@qq.com> Date: Wed, 18 Sep 2024 18:07:53 +0800 Subject: [PATCH] fix bugs in initialization of global variables --- kernelmode/vgpu/global.h | 6 +++--- kernelmode/vgpu/vgpu.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kernelmode/vgpu/global.h b/kernelmode/vgpu/global.h index 429d955..c22e4c6 100644 --- a/kernelmode/vgpu/global.h +++ b/kernelmode/vgpu/global.h @@ -110,9 +110,9 @@ typedef struct _VGPU_BUFFER { }VGPU_BUFFER, * PVGPU_BUFFER; // gloval variables -CAPSETS Capsets; -LIST_ENTRY VirglContextList; -KSPIN_LOCK VirglContextListSpinLock; +extern CAPSETS Capsets; +extern LIST_ENTRY VirglContextList; +extern KSPIN_LOCK VirglContextListSpinLock; #define VGPU_DEBUG_TAG() KdPrint(("[Mvisor] Func:%s Line:%d \n", __FUNCTION__, __LINE__)) #define VGPU_DEBUG_PRINT(string) KdPrint(("[Mvisor] Func:%s Line:%d " string "\n", __FUNCTION__, __LINE__)) diff --git a/kernelmode/vgpu/vgpu.c b/kernelmode/vgpu/vgpu.c index 9fbe772..1a8dc35 100644 --- a/kernelmode/vgpu/vgpu.c +++ b/kernelmode/vgpu/vgpu.c @@ -24,6 +24,11 @@ #include "memory.h" #include "idr.h" +// gloval variables +CAPSETS Capsets; +LIST_ENTRY VirglContextList; +KSPIN_LOCK VirglContextListSpinLock; + #pragma code_seg(push) #pragma code_seg()