From 96647a898d62d699808316238dfb933d960413f2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:46 +0200 Subject: Merging upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- include/VBox/VBoxLnxModInline.h | 66 +++++++++++++++++++++++++++++++++++++++++ include/VBox/VBoxTpG.h | 3 +- include/VBox/intnet.h | 3 +- include/VBox/log.h | 4 +-- include/VBox/sup.h | 3 +- include/VBox/vusb.h | 19 ++++++++++-- 6 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 include/VBox/VBoxLnxModInline.h (limited to 'include/VBox') diff --git a/include/VBox/VBoxLnxModInline.h b/include/VBox/VBoxLnxModInline.h new file mode 100644 index 00000000..3b0e115d --- /dev/null +++ b/include/VBox/VBoxLnxModInline.h @@ -0,0 +1,66 @@ +/* $Id: VBoxLnxModInline.h $ */ +/** @file + * A common code for VirtualBox Linux kernel modules. + */ + +/* + * Copyright (C) 2006-2024 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef VBOX_INCLUDED_VBoxLnxModInline_h +#define VBOX_INCLUDED_VBoxLnxModInline_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +# include +# include + +/** Disable automatic module loading. */ +static int g_fDisabled = -1; +MODULE_PARM_DESC(disabled, "Disable automatic module loading"); +module_param_named(disabled, g_fDisabled, int, 0400); + +/** + * Check if module loading was explicitly disabled. + * + * Usually module loading can be disabled by + * specifying mod_name.disabled=1 in kernel command line. + * + * @returns True if modules loading was disabled, False otherwise. + */ +static inline bool vbox_mod_should_load(void) +{ + bool fShouldLoad = (g_fDisabled != 1); + + /* Print message into dmesg log if module loading was disabled. */ + if (!fShouldLoad) + printk(KERN_WARNING "%s: automatic module loading disabled in kernel command line\n", + module_name(THIS_MODULE)); + + return fShouldLoad; +} + +#endif /* !VBOX_INCLUDED_VBoxLnxModInline_h */ + diff --git a/include/VBox/VBoxTpG.h b/include/VBox/VBoxTpG.h index de1d1733..304d6612 100644 --- a/include/VBox/VBoxTpG.h +++ b/include/VBox/VBoxTpG.h @@ -228,7 +228,8 @@ typedef struct VTGDESCARGLIST uint8_t cArgs; uint8_t fHaveLargeArgs; uint8_t abReserved[2]; - VTGDESCARG aArgs[1]; + RT_FLEXIBLE_ARRAY_EXTENSION + VTGDESCARG aArgs[RT_FLEXIBLE_ARRAY]; } VTGDESCARGLIST; /** Pointer to a VTG argument list descriptor. */ typedef VTGDESCARGLIST *PVTGDESCARGLIST; diff --git a/include/VBox/intnet.h b/include/VBox/intnet.h index 815143ff..2e593067 100644 --- a/include/VBox/intnet.h +++ b/include/VBox/intnet.h @@ -355,7 +355,8 @@ typedef struct INTNETSG /** The number of segments actually used. */ uint16_t cSegsUsed; /** Variable sized list of segments. */ - INTNETSEG aSegs[1]; + RT_FLEXIBLE_ARRAY_EXTENSION + INTNETSEG aSegs[RT_FLEXIBLE_ARRAY]; } INTNETSG; AssertCompileSizeAlignment(INTNETSG, 8); /** Pointer to a scatter / gather list. */ diff --git a/include/VBox/log.h b/include/VBox/log.h index af00cf90..a6439020 100644 --- a/include/VBox/log.h +++ b/include/VBox/log.h @@ -592,10 +592,10 @@ typedef enum VBOXLOGGROUP LOG_GROUP_MAIN_PROGRESSCREATEDEVENT, /** Main group, IProgressEvent. */ LOG_GROUP_MAIN_PROGRESSEVENT, - /** Main group, IRangedIntegerFormValue. */ - LOG_GROUP_MAIN_RANGEDINTEGERFORMVALUE, /** Main group, IRangedInteger64FormValue. */ LOG_GROUP_MAIN_RANGEDINTEGER64FORMVALUE, + /** Main group, IRangedIntegerFormValue. */ + LOG_GROUP_MAIN_RANGEDINTEGERFORMVALUE, /** Main group, IRecordingScreenSettings. */ LOG_GROUP_MAIN_RECORDINGSCREENSETTINGS, /** Main group, IRecordingSettings. */ diff --git a/include/VBox/sup.h b/include/VBox/sup.h index 877d0b38..0b718f7c 100644 --- a/include/VBox/sup.h +++ b/include/VBox/sup.h @@ -561,7 +561,8 @@ typedef struct SUPGLOBALINFOPAGE * is SUPGIPMODE_ASYNC_TSC. If @c u32Mode is SUPGIPMODE_SYNC_TSC only the first * entry is updated. If @c u32Mode is SUPGIPMODE_SYNC_TSC the TSC frequency in * @c u64CpuHz is copied to all CPUs. */ - SUPGIPCPU aCPUs[1]; + RT_FLEXIBLE_ARRAY_EXTENSION + SUPGIPCPU aCPUs[RT_FLEXIBLE_ARRAY]; } SUPGLOBALINFOPAGE; AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, u64NanoTSLastUpdateHz, 8); AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, OnlineCpuSet, 64); diff --git a/include/VBox/vusb.h b/include/VBox/vusb.h index 4a3f6d09..3649c28b 100644 --- a/include/VBox/vusb.h +++ b/include/VBox/vusb.h @@ -869,7 +869,19 @@ typedef struct VUSBIROOTHUBCONNECTOR * @param EndPt Endpoint number. * @param enmDir Endpoint direction. */ - DECLR3CALLBACKMEMBER(int, pfnAbortEp,(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t uPort, int EndPt, VUSBDIRECTION enmDir)); + DECLR3CALLBACKMEMBER(int, pfnAbortEpByPort,(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t uPort, int EndPt, VUSBDIRECTION enmDir)); + + /** + * Cancels and completes - with CRC failure - all URBs queued on an endpoint. + * This is done in response to a guest endpoint/pipe abort. + * + * @returns VBox status code. + * @param pInterface Pointer to this struct. + * @param DstAddress Port of the device. + * @param EndPt Endpoint number. + * @param enmDir Endpoint direction. + */ + DECLR3CALLBACKMEMBER(int, pfnAbortEpByAddr,(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, int EndPt, VUSBDIRECTION enmDir)); /** * Attach the device to the root hub. @@ -1003,10 +1015,13 @@ typedef struct VUSBIROOTHUBCONNECTOR */ DECLR3CALLBACKMEMBER(VUSBSPEED, pfnDevGetSpeed,(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t uPort)); + /** Alignment dummy. */ + RTR3PTR Alignment; + } VUSBIROOTHUBCONNECTOR; AssertCompileSizeAlignment(VUSBIROOTHUBCONNECTOR, 8); /** VUSBIROOTHUBCONNECTOR interface ID. */ -# define VUSBIROOTHUBCONNECTOR_IID "662d7822-b9c6-43b5-88b6-5d59f0106e46" +# define VUSBIROOTHUBCONNECTOR_IID "83eb1fb4-d755-4925-a7c5-751d0899c048" # ifdef IN_RING3 -- cgit v1.2.3