Commit 30742523 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

UBUNTU: ubuntu: vbox -- update to 5.0.14-dfsg-2

BugLink: http://bugs.launchpad.net/bugs/1542728Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent 22bc9b9b
Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_5.0.0-dfsg-1_all.deb
Version: 5.0.0-dfsg-1
Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_5.0.14-dfsg-2_all.deb
Version: 5.0.14-dfsg-2
......@@ -35,7 +35,14 @@
#include <VBox/VBoxGuest2.h>
/** @defgroup grp_vboxguest VirtualBox Guest Additions Driver Interface
/** @defgroup grp_vboxguest VirtualBox Guest Additions Device Driver
*
* Also know as VBoxGuest.
*
* @{
*/
/** @defgroup grp_vboxguest_ioc VirtualBox Guest Additions Driver Interface
* @{
*/
......@@ -553,5 +560,6 @@ typedef VBOXGUESTOS2IDCCONNECT *PVBOXGUESTOS2IDCCONNECT;
/** @} */
/** @} */
#endif
......@@ -32,6 +32,8 @@
#ifdef VBOX_WITH_HGCM
# include <VBox/VMMDev2.h>
/** @addtogroup grp_vmmdev
* @{ */
/**
* HGCM connect info structure.
......@@ -102,6 +104,8 @@ typedef struct VBoxGuestHGCMCallInfoTimed
AssertCompileSize(VBoxGuestHGCMCallInfoTimed, 8+16);
# pragma pack()
/** @} */
#endif /* VBOX_WITH_HGCM */
#endif
......
This diff is collapsed.
/* $Id: VBoxGuestLibSharedFolders.h $ */
/** @file
* VBoxGuestLib - Central calls header.
*/
/*
* Copyright (C) 2006-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_VBoxGuestLibSharedFolders_h_
#define ___VBox_VBoxGuestLibSharedFolders_h_
#include <VBox/VBoxGuestLib.h>
#include <VBox/shflsvc.h>
RT_C_DECLS_BEGIN
/** @addtogroup grp_vboxguest_lib_r0
* @{
*/
typedef struct VBGLSFCLIENT
{
HGCMCLIENTID idClient;
VBGLHGCMHANDLE handle;
} VBGLSFCLIENT;
typedef VBGLSFCLIENT *PVBGLSFCLIENT;
typedef struct VBGLSFMAP
{
SHFLROOT root;
} VBGLSFMAP, *PVBGLSFMAP;
DECLVBGL(int) VbglR0SfInit(void);
DECLVBGL(void) VbglR0SfTerm(void);
DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient);
DECLVBGL(void) VbglR0SfDisconnect(PVBGLSFCLIENT pClient);
DECLVBGL(int) VbglR0SfQueryMappings(PVBGLSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
DECLVBGL(int) VbglR0SfQueryMapName(PVBGLSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
/**
* Create a new file or folder or open an existing one in a shared folder. Proxies
* to vbsfCreate in the host shared folder service.
*
* @returns IPRT status code, but see note below
* @param pClient Host-guest communication connection
* @param pMap The mapping for the shared folder in which the file
* or folder is to be created
* @param pParsedPath The path of the file or folder relative to the shared
* folder
* @param pCreateParms Parameters for file/folder creation. See the
* structure description in shflsvc.h
* @retval pCreateParms See the structure description in shflsvc.h
*
* @note This function reports errors as follows. The return value is always
* VINF_SUCCESS unless an exceptional condition occurs - out of
* memory, invalid arguments, etc. If the file or folder could not be
* opened or created, pCreateParms->Handle will be set to
* SHFL_HANDLE_NIL on return. In this case the value in
* pCreateParms->Result provides information as to why (e.g.
* SHFL_FILE_EXISTS). pCreateParms->Result is also set on success
* as additional information.
*/
DECLVBGL(int) VbglR0SfCreate(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
DECLVBGL(int) VbglR0SfClose(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE Handle);
DECLVBGL(int) VbglR0SfRemove(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
DECLVBGL(int) VbglR0SfRename(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
DECLVBGL(int) VbglR0SfFlush(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile);
DECLVBGL(int) VbglR0SfRead(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
DECLVBGL(int) VbglR0SfReadPageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
DECLVBGL(int) VbglR0SfWrite(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
DECLVBGL(int) VbglR0SfWritePhysCont(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset,
uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
DECLVBGL(int) VbglR0SfWritePageList(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer,
uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
DECLVBGL(int) VbglR0SfLock(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
DECLVBGL(int) VbglR0SfDirInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
DECLVBGL(int) VbglR0SfFsInfo(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
DECLVBGL(int) VbglR0SfMapFolder(PVBGLSFCLIENT pClient, PSHFLSTRING szFolderName, PVBGLSFMAP pMap);
DECLVBGL(int) VbglR0SfUnmapFolder(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap);
DECLVBGL(int) VbglR0SfSetUtf8(PVBGLSFCLIENT pClient);
DECLVBGL(int) VbglR0SfReadLink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
DECLVBGL(int) VbglR0SfSymlink(PVBGLSFCLIENT pClient, PVBGLSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
DECLVBGL(int) VbglR0SfSetSymlinks(PVBGLSFCLIENT pClient);
/** @} */
RT_C_DECLS_END
#endif
......@@ -41,7 +41,7 @@ RT_C_DECLS_BEGIN
/** @defgroup grp_vmmdev VMM Device
*
* Note! This interface cannot be changed, it can only be extended!
* @note This interface cannot be changed, it can only be extended!
*
* @{
*/
......@@ -743,6 +743,11 @@ AssertCompileSize(VBoxGuestFacilityType, 4);
/**
* The current guest status of a facility.
* This needs to be kept in sync with AdditionsFacilityStatus of the Main API!
*
* @remarks r=bird: Pretty please, for future types like this, simply do a
* linear allocation without any gaps. This stuff is impossible work
* efficiently with, let alone validate. Applies to the other facility
* enums too.
*/
typedef enum
{
......
......@@ -28,6 +28,12 @@
#include <iprt/assert.h>
/** @addtogroup grp_vmmdev
* @{
*/
/**
* Seamless mode.
*
......@@ -110,5 +116,7 @@ AssertCompileSize(HGCMServiceLocation, 128+4);
struct VMMDevReqMousePointer;
struct VMMDevMemory;
/** @} */
#endif
......@@ -29,6 +29,10 @@
#include <iprt/cdefs.h>
/** @defgroup VBox Common Defintions and Macros
* @{
*/
/** @def VBOX_WITH_STATISTICS
* When defined all statistics will be included in the build.
* This is enabled by default in all debug builds.
......@@ -442,6 +446,12 @@
# define VBOXDDU_DECL(type) DECLIMPORT(type) VBOXCALL
#endif
/** @} */
/** @defgroup grp_devdrv Device Emulations and Drivers
* @{ */
/** @} */
#endif
......@@ -30,7 +30,7 @@
#include <iprt/err.h>
/** @defgroup grp_err Error Codes
/** @defgroup grp_err VBox Error Codes
* @{
*/
......@@ -246,6 +246,8 @@
#define VERR_EM_CANNOT_EXEC_GUEST (-1156)
/** Reason for leaving RC: Inject a TRPM event. */
#define VINF_EM_RAW_INJECT_TRPM_EVENT 1157
/** Guest tried to trigger a CPU hang. The guest is probably up to no good. */
#define VERR_EM_GUEST_CPU_HANG (-1158)
/** @} */
......@@ -491,7 +493,7 @@
#define VINF_PGM_PHYS_TLB_CATCH_WRITE 1635
/** Catch write access and route it thru PGM. */
#define VERR_PGM_PHYS_TLB_CATCH_WRITE (-1635)
/** No CR3 root shadow page table.. */
/** No CR3 root shadow page table. */
#define VERR_PGM_NO_CR3_SHADOW_ROOT (-1636)
/** Trying to free a page with an invalid Page ID. */
#define VERR_PGM_PHYS_INVALID_PAGE_ID (-1637)
......@@ -1143,8 +1145,8 @@
#define VERR_VMM_RING3_CALL_DISABLED (-2703)
/** The VMMR0.r0 module version does not match VBoxVMM.dll/so/dylib.
* If you just upgraded VirtualBox, please terminate all VMs and make sure
* VBoxNetDHCP is not running. Then try again. If this error persists, try
* re-installing VirtualBox. */
* that neither VBoxNetDHCP nor VBoxNetNAT is running. Then try again.
* If this error persists, try re-installing VirtualBox. */
#define VERR_VMM_R0_VERSION_MISMATCH (-2704)
/** The VMMRC.rc module version does not match VBoxVMM.dll/so/dylib.
* Re-install if you are a user. Developers should make sure the build is
......@@ -1172,6 +1174,9 @@
#define VERR_VMM_SWITCHER_STUB (-2715)
/** HM returned in the wrong state. */
#define VERR_VMM_WRONG_HM_VMCPU_STATE (-2716)
/** SMAP enabled, but the AC flag was found to be clear - check the kernel
* log for details. */
#define VERR_VMM_SMAP_BUT_AC_CLEAR (-2717)
/** @} */
......@@ -1618,6 +1623,15 @@
#define VERR_VD_DMG_XML_PARSE_ERROR (-3284)
/** Unable to locate a usable DMG file within the XAR archive. */
#define VERR_VD_DMG_NOT_FOUND_INSIDE_XAR (-3285)
/** The size of the raw image is not dividable by 512 */
#define VERR_VD_RAW_SIZE_MODULO_512 (-3286)
/** The size of the raw image is not dividable by 2048 */
#define VERR_VD_RAW_SIZE_MODULO_2048 (-3287)
/** The size of the raw optical image is too small (<= 32K) */
#define VERR_VD_RAW_SIZE_OPTICAL_TOO_SMALL (-3288)
/** The size of the raw floppy image is too big (>2.88MB) */
#define VERR_VD_RAW_SIZE_FLOPPY_TOO_BIG (-3289)
/** @} */
......@@ -1808,6 +1822,10 @@
#define VWRN_SUPDRV_TSC_DELTA_MEASUREMENT_FAILED 3746
/** A TSC-delta measurement request is currently being serviced. */
#define VERR_SUPDRV_TSC_DELTA_MEASUREMENT_BUSY (-3747)
/** The process trying to open VBoxDrv is not a budding VM process (1). */
#define VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_1 (-3748)
/** The process trying to open VBoxDrv is not a budding VM process (2). */
#define VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_2 (-3749)
/** @} */
......@@ -2017,9 +2035,9 @@
/** Internal VMX processing error no 5. */
#define VERR_VMX_IPE_5 (-4027)
/** VT-x features for all modes (SMX and non-SMX) disabled by the BIOS. */
#define VERR_VMX_MSR_ALL_VMXON_DISABLED (-4028)
#define VERR_VMX_MSR_ALL_VMX_DISABLED (-4028)
/** VT-x features disabled by the BIOS. */
#define VERR_VMX_MSR_VMXON_DISABLED (-4029)
#define VERR_VMX_MSR_VMX_DISABLED (-4029)
/** VM-Entry Controls internal cache invalid. */
#define VERR_VMX_ENTRY_CTLS_CACHE_INVALID (-4030)
/** VM-Exit Controls internal cache invalid. */
......@@ -2032,6 +2050,10 @@
/** VM-Execution Secondary Processor-based Controls internal
* cache invalid. */
#define VERR_VMX_PROC_EXEC2_CTLS_CACHE_INVALID (-4034)
/** Failed to set VMXON enable bit while enabling VT-x through the MSR. */
#define VERR_VMX_MSR_VMX_ENABLE_FAILED (-4035)
/** Failed to enable VMXON-in-SMX bit while enabling VT-x through the MSR. */
#define VERR_VMX_MSR_SMX_VMX_ENABLE_FAILED (-4036)
/** @} */
......@@ -2338,7 +2360,7 @@
#define VINF_DBGC_BP_NO_COMMAND 5406
/** Generic debugger command failure. */
#define VERR_DBGC_COMMAND_FAILED (-5407)
/** Logic bug in the DBGC code.. */
/** Logic bug in the DBGC code. */
#define VERR_DBGC_IPE (-5408)
/** The lowest parse status code. */
......@@ -2652,6 +2674,7 @@
#define VERR_GIM_HYPERCALL_ACCESS_DENIED (-6311)
/** @} */
/** @name Main API Status Codes
* @{
*/
......@@ -2663,6 +2686,7 @@
#define VERR_MAIN_CONFIG_CONSTRUCTOR_IPE (-6401)
/** @} */
/** @name VBox Drag and Drop Status Codes
* @{
*/
......@@ -2671,6 +2695,16 @@
/** @} */
/** @name Audio Status Codes
* @{
*/
/** Host backend couldn't be initialized. Happen if the audio server is not
* reachable, audio hardware is not available or similar. We should use the
* NULL audio driver. */
#define VERR_AUDIO_BACKEND_INIT_FAILED (-6600)
/** @} */
/* SED-END */
/** @} */
......
......@@ -72,7 +72,7 @@ struct VBOXHGCMCALLHANDLE_TYPEDEF;
typedef struct VBOXHGCMCALLHANDLE_TYPEDEF *VBOXHGCMCALLHANDLE;
/** Service helpers pointers table. */
typedef struct _VBOXHGCMSVCHELPERS
typedef struct VBOXHGCMSVCHELPERS
{
/** The service has processed the Call request. */
DECLR3CALLBACKMEMBER(void, pfnCallComplete, (VBOXHGCMCALLHANDLE callHandle, int32_t rc));
......@@ -354,10 +354,11 @@ typedef FNHGCMSVCEXT *PFNHGCMSVCEXT;
*/
/* The structure is used in separately compiled binaries so an explicit packing is required. */
#pragma pack(1)
typedef struct _VBOXHGCMSVCFNTABLE
#pragma pack(1) /** @todo r=bird: The pragma pack(1) is not at all required!! */
typedef struct VBOXHGCMSVCFNTABLE
{
/** Filled by HGCM */
/** @name Filled by HGCM
* @{ */
/** Size of the structure. */
uint32_t cbSize;
......@@ -366,8 +367,10 @@ typedef struct _VBOXHGCMSVCFNTABLE
uint32_t u32Version;
PVBOXHGCMSVCHELPERS pHelpers;
/** @} */
/** Filled by the service. */
/** @name Filled in by the service.
* @{ */
/** Size of client information the service want to have. */
uint32_t cbClient;
......@@ -407,6 +410,7 @@ typedef struct _VBOXHGCMSVCFNTABLE
/** User/instance data pointer for the service. */
void *pvService;
/** @} */
} VBOXHGCMSVCFNTABLE;
#pragma pack()
......
......@@ -36,7 +36,7 @@
#include <iprt/log.h>
/** @defgroup grp_rt_vbox_log VirtualBox Logging
/** @defgroup grp_rt_vbox_log VBox Logging
* @ingroup grp_rt_vbox
* @{
*/
......@@ -740,7 +740,7 @@ typedef enum LOGGROUP
/** USB webcam. */
LOG_GROUP_USB_WEBCAM,
/** VBox Guest Additions Driver (VBoxGuest). */
LOG_GROUP_VBGD,
LOG_GROUP_VGDRV,
/** VBox Guest Additions Library. */
LOG_GROUP_VBGL,
/** Generic virtual disk layer. */
......@@ -1138,7 +1138,7 @@ typedef enum LOGGROUP
"USB_MSD", \
"USB_REMOTE", \
"USB_WEBCAM", \
"VBGD", \
"VGDRV", \
"VBGL", \
"VD", \
"VD_DMG", \
......
......@@ -599,7 +599,7 @@ typedef enum _SHFLCREATERESULT
/** Write access requested. */
#define SHFL_CF_ACCESS_ATTR_WRITE (0x00020000)
/** Read/Write access requested. */
#define SHFL_CF_ACCESS_ATTR_READWRITE (SHFL_CF_ACCESS_READ | SHFL_CF_ACCESS_WRITE)
#define SHFL_CF_ACCESS_ATTR_READWRITE (SHFL_CF_ACCESS_ATTR_READ | SHFL_CF_ACCESS_ATTR_WRITE)
/** The file is opened in append mode. Ignored if SHFL_CF_ACCESS_WRITE is not set. */
#define SHFL_CF_ACCESS_APPEND (0x00040000)
......
......@@ -30,7 +30,7 @@
#include <iprt/types.h>
/** @defgroup grp_types Basic VBox Types
/** @defgroup grp_types VBox Basic Types
* @{
*/
......
......@@ -261,7 +261,7 @@ DECLINLINE(void) ASMGetGDTR(PRTGDTR pGdtr)
/**
* Sets the content of the GDTR CPU register.
* @param pIdtr Where to load the GDTR contents from
* @param pGdtr Where to load the GDTR contents from
*/
#if RT_INLINE_ASM_EXTERNAL
DECLASM(void) ASMSetGDTR(const RTGDTR *pGdtr);
......@@ -596,6 +596,184 @@ DECLINLINE(void) ASMSetFlags(RTCCUINTREG uFlags)
#endif
/**
* Modifies the [RE]FLAGS register.
* @returns Original value.
* @param fAndEfl Flags to keep (applied first).
* @param fOrEfl Flags to be set.
*/
#if RT_INLINE_ASM_EXTERNAL && RT_INLINE_ASM_USES_INTRIN < 15
DECLASM(RTCCUINTREG) ASMChangeFlags(RTCCUINTREG fAndEfl, RTCCUINTREG fOrEfl);
#else
DECLINLINE(RTCCUINTREG) ASMChangeFlags(RTCCUINTREG fAndEfl, RTCCUINTREG fOrEfl)
{
RTCCUINTREG fOldEfl;
# if RT_INLINE_ASM_GNU_STYLE
# ifdef RT_ARCH_AMD64
__asm__ __volatile__("pushfq\n\t"
"movq (%%rsp), %0\n\t"
"andq %0, %1\n\t"
"orq %3, %1\n\t"
"mov %1, (%%rsp)\n\t"
"popfq\n\t"
: "=&r" (fOldEfl),
"=r" (fAndEfl)
: "1" (fAndEfl),
"rn" (fOrEfl) );
# else
__asm__ __volatile__("pushfl\n\t"
"movl (%%esp), %0\n\t"
"andl %1, (%%esp)\n\t"
"orl %2, (%%esp)\n\t"
"popfl\n\t"
: "=&r" (fOldEfl)
: "rn" (fAndEfl),
"rn" (fOrEfl) );
# endif
# elif RT_INLINE_ASM_USES_INTRIN >= 15
fOldEfl = __readeflags();
__writeeflags((fOldEfl & fAndEfl) | fOrEfl);
# else
__asm
{
# ifdef RT_ARCH_AMD64
mov rdx, [fAndEfl]
mov rcx, [fOrEfl]
pushfq
mov rax, [rsp]
and rdx, rax
or rdx, rcx
mov [rsp], rdx
popfq
mov [fOldEfl], rax
# else
mov edx, [fAndEfl]
mov ecx, [fOrEfl]
pushfd
mov eax, [esp]
and edx, eax
or edx, ecx
mov [esp], edx
popfd
mov [fOldEfl], eax
# endif
}
# endif
return fOldEfl;
}
#endif
/**
* Modifies the [RE]FLAGS register by ORing in one or more flags.
* @returns Original value.
* @param fOrEfl The flags to be set (ORed in).
*/
#if RT_INLINE_ASM_EXTERNAL && RT_INLINE_ASM_USES_INTRIN < 15
DECLASM(RTCCUINTREG) ASMAddFlags(RTCCUINTREG fOrEfl);
#else
DECLINLINE(RTCCUINTREG) ASMAddFlags(RTCCUINTREG fOrEfl)
{
RTCCUINTREG fOldEfl;
# if RT_INLINE_ASM_GNU_STYLE
# ifdef RT_ARCH_AMD64
__asm__ __volatile__("pushfq\n\t"
"movq (%%rsp), %0\n\t"
"orq %1, (%%rsp)\n\t"
"popfq\n\t"
: "=&r" (fOldEfl)
: "rn" (fOrEfl) );
# else
__asm__ __volatile__("pushfl\n\t"
"movl (%%esp), %0\n\t"
"orl %1, (%%esp)\n\t"
"popfl\n\t"
: "=&r" (fOldEfl)
: "rn" (fOrEfl) );
# endif
# elif RT_INLINE_ASM_USES_INTRIN >= 15
fOldEfl = __readeflags();
__writeeflags(fOldEfl | fOrEfl);
# else
__asm
{
# ifdef RT_ARCH_AMD64
mov rcx, [fOrEfl]
pushfq
mov rdx, [rsp]
or [rsp], rcx
popfq
mov [fOldEfl], rax
# else
mov ecx, [fOrEfl]
pushfd
mov edx, [esp]
or [esp], ecx
popfd
mov [fOldEfl], eax
# endif
}
# endif
return fOldEfl;
}
#endif
/**
* Modifies the [RE]FLAGS register by AND'ing out one or more flags.
* @returns Original value.
* @param fAndEfl The flags to keep.
*/
#if RT_INLINE_ASM_EXTERNAL && RT_INLINE_ASM_USES_INTRIN < 15
DECLASM(RTCCUINTREG) ASMClearFlags(RTCCUINTREG fAndEfl);
#else
DECLINLINE(RTCCUINTREG) ASMClearFlags(RTCCUINTREG fAndEfl)
{
RTCCUINTREG fOldEfl;
# if RT_INLINE_ASM_GNU_STYLE
# ifdef RT_ARCH_AMD64
__asm__ __volatile__("pushfq\n\t"
"movq (%%rsp), %0\n\t"
"andq %1, (%%rsp)\n\t"
"popfq\n\t"
: "=&r" (fOldEfl)
: "rn" (fAndEfl) );
# else
__asm__ __volatile__("pushfl\n\t"
"movl (%%esp), %0\n\t"
"andl %1, (%%esp)\n\t"
"popfl\n\t"
: "=&r" (fOldEfl)
: "rn" (fAndEfl) );
# endif
# elif RT_INLINE_ASM_USES_INTRIN >= 15
fOldEfl = __readeflags();
__writeeflags(fOldEfl & fAndEfl);
# else
__asm
{
# ifdef RT_ARCH_AMD64
mov rdx, [fAndEfl]
pushfq
mov rdx, [rsp]
and [rsp], rdx
popfq
mov [fOldEfl], rax
# else
mov edx, [fAndEfl]
pushfd
mov edx, [esp]
and [esp], edx
popfd
mov [fOldEfl], eax
# endif
}
# endif
return fOldEfl;
}
#endif
/**
* Gets the content of the CPU timestamp counter register.
*
......
......@@ -132,7 +132,7 @@
# define RT_INLINE_ASM_GCC_4_3_X_X86 0
#endif
/** @def RT_INLINE_DONT_USE_CMPXCHG8B
/** @def RT_INLINE_DONT_MIX_CMPXCHG8B_AND_PIC
* i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) screws up
* RTSemRWRequestWrite semsemrw-lockless-generic.cpp in release builds. PIC
* mode, x86.
......@@ -4321,13 +4321,13 @@ DECLINLINE(void) ASMBitClearRange(volatile void *pvBitmap, int32_t iBitStart, in
int iStart = iBitStart & ~31;
int iEnd = iBitEnd & ~31;
if (iStart == iEnd)
*pu32 &= ((1 << (iBitStart & 31)) - 1) | ~((1 << (iBitEnd & 31)) - 1);
*pu32 &= ((1U << (iBitStart & 31)) - 1) | ~((1U << (iBitEnd & 31)) - 1);
else
{
/* bits in first dword. */
if (iBitStart & 31)
{
*pu32 &= (1 << (iBitStart & 31)) - 1;
*pu32 &= (1U << (iBitStart & 31)) - 1;
pu32++;
iBitStart = iStart + 32;
}
......@@ -4340,7 +4340,7 @@ DECLINLINE(void) ASMBitClearRange(volatile void *pvBitmap, int32_t iBitStart, in
if (iBitEnd & 31)
{
pu32 = (volatile uint32_t *)pvBitmap + (iBitEnd >> 5);
*pu32 &= ~((1 << (iBitEnd & 31)) - 1);
*pu32 &= ~((1U << (iBitEnd & 31)) - 1);
}
}
}
......@@ -4362,13 +4362,13 @@ DECLINLINE(void) ASMBitSetRange(volatile void *pvBitmap, int32_t iBitStart, int3
int iStart = iBitStart & ~31;
int iEnd = iBitEnd & ~31;
if (iStart == iEnd)
*pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << iBitStart;
*pu32 |= ((1U << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31);
else
{
/* bits in first dword. */
if (iBitStart & 31)
{
*pu32 |= ~((1 << (iBitStart & 31)) - 1);
*pu32 |= ~((1U << (iBitStart & 31)) - 1);
pu32++;
iBitStart = iStart + 32;
}
......@@ -4381,7 +4381,7 @@ DECLINLINE(void) ASMBitSetRange(volatile void *pvBitmap, int32_t iBitStart, int3
if (iBitEnd & 31)
{
pu32 = (volatile uint32_t *)pvBitmap + (iBitEnd >> 5);
*pu32 |= (1 << (iBitEnd & 31)) - 1;
*pu32 |= (1U << (iBitEnd & 31)) - 1;
}
}
}
......
......@@ -98,7 +98,7 @@ RTDECL(void) RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char
* @param pszFormat Printf like format string.
* @param ... Arguments to that string.
*/
RTDECL(void) RTAssertMsg2(const char *pszFormat, ...);
RTDECL(void) RTAssertMsg2(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/**
* Weak version of RTAssertMsg2 that forwards to RTAssertMsg2WeakV.
*
......@@ -106,7 +106,7 @@ RTDECL(void) RTAssertMsg2(const char *pszFormat, ...);
*
* @copydoc RTAssertMsg2
*/
RTDECL(void) RTAssertMsg2Weak(const char *pszFormat, ...);
RTDECL(void) RTAssertMsg2Weak(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/**
* The 2nd (optional) part of an assert message.
......@@ -114,14 +114,14 @@ RTDECL(void) RTAssertMsg2Weak(const char *pszFormat, ...);
* @param pszFormat Printf like format string.
* @param va Arguments to that string.
*/
RTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va);
RTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
/**
* Weak version of RTAssertMsg2V that can be overridden locally in a module to
* modify, redirect or otherwise mess with the assertion output.
*
* @copydoc RTAssertMsg2V
*/
RTDECL(void) RTAssertMsg2WeakV(const char *pszFormat, va_list va);
RTDECL(void) RTAssertMsg2WeakV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
/**
* Additional information which should be appended to the 2nd part of an
......@@ -130,7 +130,7 @@ RTDECL(void) RTAssertMsg2WeakV(const char *pszFormat, va_list va);
* @param pszFormat Printf like format string.
* @param ... Arguments to that string.
*/
RTDECL(void) RTAssertMsg2Add(const char *pszFormat, ...);
RTDECL(void) RTAssertMsg2Add(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/**
* Weak version of RTAssertMsg2Add that forwards to RTAssertMsg2AddWeakV.
*
......@@ -138,7 +138,7 @@ RTDECL(void) RTAssertMsg2Add(const char *pszFormat, ...);
*
* @copydoc RTAssertMsg2Add
*/
RTDECL(void) RTAssertMsg2AddWeak(const char *pszFormat, ...);
RTDECL(void) RTAssertMsg2AddWeak(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/**
* Additional information which should be appended to the 2nd part of an
......@@ -147,14 +147,14 @@ RTDECL(void) RTAssertMsg2AddWeak(const char *pszFormat, ...);
* @param pszFormat Printf like format string.
* @param va Arguments to that string.
*/
RTDECL(void) RTAssertMsg2AddV(const char *pszFormat, va_list va);
RTDECL(void) RTAssertMsg2AddV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
/**
* Weak version of RTAssertMsg2AddV that can be overridden locally in a module
* to modify, redirect or otherwise mess with the assertion output.
*
* @copydoc RTAssertMsg2AddV
*/
RTDECL(void) RTAssertMsg2AddWeakV(const char *pszFormat, va_list va);
RTDECL(void) RTAssertMsg2AddWeakV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
#ifdef IN_RING0
/**
......@@ -1589,7 +1589,7 @@ RT_C_DECLS_END
return (rc); \
} while (0)
/** @def AssertLogRelMsgFailedReturn
/** @def AssertLogRelMsgFailedReturnStmt
* An assertion failed, execute @a stmt and return @a rc.
* Strict builds will hit a breakpoint, non-strict will only do LogRel.
*
......@@ -1621,7 +1621,7 @@ RT_C_DECLS_END
return; \
} while (0)
/** @def AssertLogRelMsgFailedReturnVoid
/** @def AssertLogRelMsgFailedReturnVoidStmt
* An assertion failed, execute @a stmt and return void.
* Strict builds will hit a breakpoint, non-strict will only do LogRel.
*
......@@ -2095,7 +2095,7 @@ RT_C_DECLS_END
*/
#define AssertRCReturn(rc, rcRet) AssertMsgRCReturn(rc, ("%Rra\n", (rc)), rcRet)
/** @def AssertRCReturn
/** @def AssertRCReturnStmt
* Asserts a iprt status code successful, bitch (RT_STRICT mode only), execute
* @a stmt and returns @a rcRet if it isn't.
*
......@@ -2115,7 +2115,7 @@ RT_C_DECLS_END
*/
#define AssertRCReturnVoid(rc) AssertMsgRCReturnVoid(rc, ("%Rra\n", (rc)))
/** @def AssertReturnVoidStmt
/** @def AssertRCReturnVoidStmt
* Asserts a iprt status code successful, bitch (RT_STRICT mode only), and
* execute the given statement/return if it isn't.
*
......
......@@ -58,6 +58,8 @@
# define __X86__
# define RT_ARCH_AMD64
# define RT_ARCH_X86
# define RT_ARCH_SPARC
# define RT_ARCH_SPARC64
# define IN_RING0
# define IN_RING3
# define IN_RC
......@@ -72,7 +74,7 @@
# define RT_LOCK_NO_STRICT
# define RT_LOCK_STRICT_ORDER
# define RT_LOCK_NO_STRICT_ORDER
# define Breakpoint
# define RT_BREAKPOINT
# define RT_NO_DEPRECATED_MACROS
# define RT_EXCEPTIONS_ENABLED
# define RT_BIG_ENDIAN
......@@ -80,6 +82,8 @@
# define RT_COMPILER_GROKS_64BIT_BITFIELDS
# define RT_COMPILER_WITH_80BIT_LONG_DOUBLE
# define RT_NO_VISIBILITY_HIDDEN
# define RT_GCC_SUPPORTS_VISIBILITY_HIDDEN
# define RT_COMPILER_SUPPORTS_LAMBDA
#endif /* DOXYGEN_RUNNING */
/** @def RT_ARCH_X86
......@@ -338,7 +342,7 @@
* Replace: # elif defined(RT_OS_\1)\n# define RT_OPSYS RT_OPSYS_\1
*/
#ifndef RT_OPSYS
# if defined(RT_OS_UNKNOWN)
# if defined(RT_OS_UNKNOWN) || defined(DOXYGEN_RUNNING)
# define RT_OPSYS RT_OPSYS_UNKNOWN
# elif defined(RT_OS_AGNOSTIC)
# define RT_OPSYS RT_OPSYS_AGNOSTIC
......@@ -876,16 +880,37 @@
# define RT_EXCEPTIONS_ENABLED
#endif
/** @def RT_NO_THROW
/** @def RT_NO_THROW_PROTO
* How to express that a function doesn't throw C++ exceptions
* and the compiler can thus save itself the bother of trying
* to catch any of them. Put this between the closing parenthesis
* and the semicolon in function prototypes (and implementation if C++).
*
* @remarks May not work on C++ methods, mainly intented for C-style APIs.
*
* @remarks The use of the nothrow attribute with GCC is because old compilers
* (4.1.1, 32-bit) leaking the nothrow into global space or something
* when used with RTDECL or similar. Using this forces use to have two
* macros, as the nothrow attribute is not for the function definition.
*/
#ifdef RT_EXCEPTIONS_ENABLED
# define RT_NO_THROW throw()
# ifdef __GNUC__
# define RT_NO_THROW_PROTO __attribute__((__nothrow__))
# else
# define RT_NO_THROW_PROTO throw()
# endif
#else
# define RT_NO_THROW_PROTO
#endif
/** @def RT_NO_THROW_DEF
* The counter part to RT_NO_THROW_PROTO that is added to the function
* definition.
*/
#if defined(RT_EXCEPTIONS_ENABLED) && !defined(__GNUC__)
# define RT_NO_THROW_DEF RT_NO_THROW_PROTO
#else
# define RT_NO_THROW
# define RT_NO_THROW_DEF
#endif
/** @def RT_THROW
......@@ -914,6 +939,31 @@
# define RT_THROW(type)
#endif
/** @def RT_IPRT_FORMAT_ATTR
* Identifies a function taking an IPRT format string.
* @param a_iFmt The index (1-based) of the format string argument.
* @param a_iArgs The index (1-based) of the first format argument, use 0 for
* va_list.
*/
#if defined(__GNUC__) && defined(WITH_IPRT_FORMAT_ATTRIBUTE)
# define RT_IPRT_FORMAT_ATTR(a_iFmt, a_iArgs) __attribute__((__iprt_format__(a_iFmt, a_iArgs)))
#else
# define RT_IPRT_FORMAT_ATTR(a_iFmt, a_iArgs)
#endif
/** @def RT_IPRT_FORMAT_ATTR_MAYBE_NULL
* Identifies a function taking an IPRT format string, NULL is allowed.
* @param a_iFmt The index (1-based) of the format string argument.
* @param a_iArgs The index (1-based) of the first format argument, use 0 for
* va_list.
*/
#if defined(__GNUC__) && defined(WITH_IPRT_FORMAT_ATTRIBUTE)
# define RT_IPRT_FORMAT_ATTR_MAYBE_NULL(a_iFmt, a_iArgs) __attribute__((__iprt_format_maybe_null__(a_iFmt, a_iArgs)))
#else
# define RT_IPRT_FORMAT_ATTR_MAYBE_NULL(a_iFmt, a_iArgs)
#endif
/** @def RT_GCC_SUPPORTS_VISIBILITY_HIDDEN
* Indicates that the "hidden" visibility attribute can be used (GCC) */
#if defined(__GNUC__)
......@@ -924,13 +974,16 @@
/** @def RTCALL
* The standard calling convention for the Runtime interfaces.
*
* @remarks The regparm(0) in the X86/GNUC variant deals with -mregparm=x use in
* the linux kernel and potentially elsewhere (3rd party).
*/
#ifdef _MSC_VER
# define RTCALL __cdecl
# define RTCALL __cdecl
#elif defined(RT_OS_OS2)
# define RTCALL __cdecl
#elif defined(__GNUC__) && defined(IN_RING0) && defined(RT_ARCH_X86) /** @todo consider dropping IN_RING0 here. */
# define RTCALL __attribute__((cdecl,regparm(0))) /* regparm(0) deals with -mregparm=x use in the linux kernel. */
# define RTCALL __cdecl
#elif defined(__GNUC__) && defined(RT_ARCH_X86)
# define RTCALL __attribute__((cdecl,regparm(0)))
#else
# define RTCALL
#endif
......@@ -998,32 +1051,16 @@
* @param type The return type of the function declaration.
*/
#ifdef __cplusplus
# if defined(_MSC_VER) || defined(RT_OS_OS2)
# define DECLASM(type) extern "C" type __cdecl
# elif defined(__GNUC__) && defined(RT_ARCH_X86)
# define DECLASM(type) extern "C" type __attribute__((cdecl,regparm(0)))
# else
# define DECLASM(type) extern "C" type
# endif
# define DECLASM(type) extern "C" type RTCALL
#else
# if defined(_MSC_VER) || defined(RT_OS_OS2)
# define DECLASM(type) type __cdecl
# elif defined(__GNUC__) && defined(RT_ARCH_X86)
# define DECLASM(type) type __attribute__((cdecl,regparm(0)))
# else
# define DECLASM(type) type
# endif
# define DECLASM(type) type RTCALL
#endif
/** @def DECLASMTYPE
* How to declare an internal assembly function type.
* @param type The return type of the function.
*/
# if defined(_MSC_VER) || defined(RT_OS_OS2)
# define DECLASMTYPE(type) type __cdecl
#else
# define DECLASMTYPE(type) type
#endif
#define DECLASMTYPE(type) type RTCALL
/** @def DECLNORETURN
* How to declare a function which does not return.
......@@ -1379,9 +1416,22 @@
#define RT_STR(str) #str
/** @def RT_XSTR
* Returns the expanded argument as a string.
* @param str Argument to expand and stringy. */
* @param str Argument to expand and stringify. */
#define RT_XSTR(str) RT_STR(str)
/** @def RT_LSTR_2
* Helper for RT_WSTR that gets the expanded @a str.
* @param str String litteral to prefix with 'L'. */
#define RT_LSTR_2(str) L##str
/** @def RT_LSTR
* Returns the expanded argument with a L string prefix.
*
* Intended for converting ASCII string \#defines into wide char string
* litterals on Windows.
*
* @param str String litteral to . */
#define RT_LSTR(str) RT_LSTR_2(str)
/** @def RT_CONCAT
* Concatenate the expanded arguments without any extra spaces in between.
*
......@@ -1392,7 +1442,7 @@
/** RT_CONCAT helper, don't use. */
#define RT_CONCAT_HLP(a,b) a##b
/** @def RT_CONCAT
/** @def RT_CONCAT3
* Concatenate the expanded arguments without any extra spaces in between.
*
* @param a The 1st part.
......@@ -1403,12 +1453,13 @@
/** RT_CONCAT3 helper, don't use. */
#define RT_CONCAT3_HLP(a,b,c) a##b##c
/** @def RT_CONCAT
/** @def RT_CONCAT4
* Concatenate the expanded arguments without any extra spaces in between.
*
* @param a The 1st part.
* @param b The 2nd part.
* @param c The 3rd part.
* @param d The 4th part.
*/
#define RT_CONCAT4(a,b,c,d) RT_CONCAT4_HLP(a,b,c,d)
/** RT_CONCAT4 helper, don't use. */
......@@ -1418,6 +1469,7 @@
* String constant tuple - string constant, strlen(string constant).
*
* @param a_szConst String constant.
* @sa RTSTRTUPLE
*/
#define RT_STR_TUPLE(a_szConst) a_szConst, (sizeof(a_szConst) - 1)
......
......@@ -505,7 +505,7 @@ RTDECL(int) RTErrInfoSet(PRTERRINFO pErrInfo, int rc, const char *pszMsg
* @param pszFormat The format string.
* @param ... The format arguments.
*/
RTDECL(int) RTErrInfoSetF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...);
RTDECL(int) RTErrInfoSetF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
/**
* Fills in the error info details, with a vsprintf style message.
......@@ -517,7 +517,7 @@ RTDECL(int) RTErrInfoSetF(PRTERRINFO pErrInfo, int rc, const char *pszFo
* @param pszFormat The format string.
* @param va The format arguments.
*/
RTDECL(int) RTErrInfoSetV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va);
RTDECL(int) RTErrInfoSetV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
/**
* Adds more error info details.
......@@ -540,7 +540,7 @@ RTDECL(int) RTErrInfoAdd(PRTERRINFO pErrInfo, int rc, const char *pszMsg
* @param pszFormat The format string to add.
* @param ... The format arguments.
*/
RTDECL(int) RTErrInfoAddF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...);
RTDECL(int) RTErrInfoAddF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
/**
* Adds more error info details, with a vsprintf style message.
......@@ -552,7 +552,7 @@ RTDECL(int) RTErrInfoAddF(PRTERRINFO pErrInfo, int rc, const char *pszFo
* @param pszFormat The format string to add.
* @param va The format arguments.
*/
RTDECL(int) RTErrInfoAddV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va);
RTDECL(int) RTErrInfoAddV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
/**
* Checks if the error info is set.
......@@ -936,6 +936,20 @@ RT_C_DECLS_END
#define VERR_MISMATCH (-22408)
/** Wrong type. */
#define VERR_WRONG_TYPE (-22409)
/** This indicates that the process does not have sufficient privileges to
* perform the operation. */
#define VERR_PRIVILEGE_NOT_HELD (-22410)
/** Process does not have the trusted code base (TCB) privilege needed for user
* authentication or/and process creation as a given user. TCB is also called
* 'Act as part of the operating system'. */
#define VERR_PROC_TCB_PRIV_NOT_HELD (-22411)
/** Process does not have the assign primary token (APT) privilege needed
* for creating process as a given user. APT is also called 'Replace a process
* level token'. */
#define VERR_PROC_APT_PRIV_NOT_HELD (-22412)
/** Process does not have the increase quota (IQ) privilege needed for
* creating a process as a given user. IQ is also called 'Increase quotas'. */
#define VERR_PROC_IQ_PRIV_NOT_HELD (-22413)
/** @} */
......@@ -1691,6 +1705,14 @@ RT_C_DECLS_END
#define VERR_HTTP_ABORTED (-893)
/** Request was redirected. */
#define VERR_HTTP_REDIRECTED (-894)
/** Proxy couldn't be resolved. */
#define VERR_HTTP_PROXY_NOT_FOUND (-895)
/** The remote host couldn't be resolved. */
#define VERR_HTTP_HOST_NOT_FOUND (-896)
/** Unexpected cURL error configure the proxy. */
#define VERR_HTTP_CURL_PROXY_CONFIG (-897)
/** Generic CURL error. */
#define VERR_HTTP_CURL_ERROR (-899)
/** @} */
/** @name RTManifest status codes
......@@ -2475,12 +2497,50 @@ RT_C_DECLS_END
/** @name RTCrDigest status codes.
* @{ */
/** OpenSSL failed to initialize the digest algorithm contextn. */
/** OpenSSL failed to initialize the digest algorithm context. */
#define VERR_CR_DIGEST_OSSL_DIGEST_INIT_ERROR (-24200)
/** OpenSSL failed to clone the digest algorithm context. */
#define VERR_CR_DIGEST_OSSL_DIGEST_CTX_COPY_ERROR (-24201)
/** @} */
/** @name RTPath status codes.
* @{ */
/** Unknown glob variable. */
#define VERR_PATH_MATCH_UNKNOWN_VARIABLE (-24400)
/** The specified glob variable must be first in the pattern. */
#define VERR_PATH_MATCH_VARIABLE_MUST_BE_FIRST (-24401)
/** Hit unimplemented glob pattern matching feature. */
#define VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED (-24402)
/** Unknown character class in glob pattern. */
#define VERR_PATH_GLOB_UNKNOWN_CHAR_CLASS (-24403)
/** @} */
/** @name RTUri status codes.
* @{ */
/** The URI is empty */
#define VERR_URI_EMPTY (-24600)
/** The URI is too short to be a valid URI. */
#define VERR_URI_TOO_SHORT (-24601)
/** Invalid scheme. */
#define VERR_URI_INVALID_SCHEME (-24602)
/** Invalid port number. */
#define VERR_URI_INVALID_PORT_NUMBER (-24603)
/** Invalid escape sequence. */
#define VERR_URI_INVALID_ESCAPE_SEQ (-24604)
/** Escape URI char decodes as zero (the C string terminator). */
#define VERR_URI_ESCAPED_ZERO (-24605)
/** Escaped URI characters does not decode to valid UTF-8. */
#define VERR_URI_ESCAPED_CHARS_NOT_VALID_UTF8 (-24606)
/** Escaped URI character is not a valid UTF-8 lead byte. */
#define VERR_URI_INVALID_ESCAPED_UTF8_LEAD_BYTE (-24607)
/** Escaped URI character sequence with invalid UTF-8 continutation byte. */
#define VERR_URI_INVALID_ESCAPED_UTF8_CONTINUATION_BYTE (-24608)
/** Missing UTF-8 continutation in escaped URI character sequence. */
#define VERR_URI_MISSING_UTF8_CONTINUATION_BYTE (-24609)
/** Expected URI using the 'file:' scheme. */
#define VERR_URI_NOT_FILE_SCHEME (-24610)
/** @} */
/* SED-END */
/** @} */
......
......@@ -116,6 +116,8 @@ RT_C_DECLS_BEGIN
#define RTFS_TYPE_WHITEOUT 0160000U
/** Type mask (S_IFMT). */
#define RTFS_TYPE_MASK 0170000U
/** The shift count to convert between RTFS_TYPE_MASK and DIRENTRYTYPE. */
#define RTFS_TYPE_DIRENTRYTYPE_SHIFT 12
/** Unix attribute mask. */
#define RTFS_UNIX_MASK 0xffffU
......@@ -592,6 +594,17 @@ typedef RTFSPROPERTIES const *PCRTFSPROPERTIES;
*/
RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties);
/**
* Checks if the given volume is case sensitive or not.
*
* This may be misleading in some cases as we lack the necessary APIs to query
* the information on some system (or choose not to use them) and are instead
* returning the general position on case sensitive file name of the system.
*
* @returns @c true if case sensitive, @c false if not.
* @param pszFsPath Path within the mounted file system.
*/
RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath);
/**
* Mountpoint enumerator callback.
......
......@@ -180,7 +180,7 @@ RTDECL(size_t) RTHeapSimpleGetFreeSize(RTHEAPSIMPLE Heap);
* @param pszFormat IPRT format string.
* @param ... Format arguments.
*/
typedef DECLCALLBACK(void) FNRTHEAPSIMPLEPRINTF(const char *pszFormat, ...);
typedef DECLCALLBACK(void) FNRTHEAPSIMPLEPRINTF(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/** Pointer to a FNRTHEAPSIMPLEPRINTF function. */
typedef FNRTHEAPSIMPLEPRINTF *PFNRTHEAPSIMPLEPRINTF;
......@@ -335,7 +335,7 @@ RTDECL(size_t) RTHeapOffsetGetFreeSize(RTHEAPOFFSET hHeap);
* @param pszFormat IPRT format string.
* @param ... Format arguments.
*/
typedef DECLCALLBACK(void) FNRTHEAPOFFSETPRINTF(const char *pszFormat, ...);
typedef DECLCALLBACK(void) FNRTHEAPOFFSETPRINTF(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
/** Pointer to a FNRTHEAPOFFSETPRINTF function. */
typedef FNRTHEAPOFFSETPRINTF *PFNRTHEAPOFFSETPRINTF;
......
......@@ -35,7 +35,13 @@ RT_C_DECLS_BEGIN
* @{
*/
/** @defgroup grp_rt_initterm Init / Term
/** @defgroup grp_rt_initterm RTInit/RTTerm - Initialization and Termination
*
* APIs for initializing and terminating the IPRT, optionally it can also
* convert input arguments to UTF-8 (in ring-3).
*
* @sa RTOnce, RTOnceEx.
*
* @{
*/
......@@ -50,6 +56,9 @@ RT_C_DECLS_BEGIN
#define RTR3INIT_FLAGS_UNOBTRUSIVE RT_BIT(2)
/** The caller ensures that the argument bector is UTF-8. */
#define RTR3INIT_FLAGS_UTF8_ARGV RT_BIT(3)
/** Indicates that this is a standalone application without any additional
* shared libraries in the application directory. Mainly windows loader mess. */
#define RTR3INIT_FLAGS_STANDALONE_APP RT_BIT(4)
/** @} */
/** @name RTR3InitEx version
......@@ -76,7 +85,7 @@ RTR3DECL(int) RTR3InitExeNoArguments(uint32_t fFlags);
* @param ppapszArgs Pointer to the argument vector pointer.
* @param fFlags Flags, see RTR3INIT_XXX.
*/
RTR3DECL(int) RTR3InitExe(int cArgs, char ***papszArgs, uint32_t fFlags);
RTR3DECL(int) RTR3InitExe(int cArgs, char ***ppapszArgs, uint32_t fFlags);
/**
* Initializes the runtime library.
......@@ -100,7 +109,7 @@ RTR3DECL(int) RTR3InitDll(uint32_t fFlags);
* @param pszProgramPath The program path. Pass NULL if we're to figure it
* out ourselves.
*/
RTR3DECL(int) RTR3InitEx(uint32_t iVersion, uint32_t fFlags, int cArgs, char ***papszArgs, const char *pszProgramPath);
RTR3DECL(int) RTR3InitEx(uint32_t iVersion, uint32_t fFlags, int cArgs, char ***ppapszArgs, const char *pszProgramPath);
/**
* Terminates the runtime library.
......
This diff is collapsed.
......@@ -69,6 +69,17 @@ typedef RTLISTANCHOR *PRTLISTANCHOR;
/** Pointer to a const doubly linked list anchor. */
typedef RTLISTANCHOR const *PCRTLISTANCHOR;
/** Version of RTLISTNODE for holding a ring-3 only list in data which gets
* shared between multiple contexts */
#if defined(IN_RING3)
typedef RTLISTNODE RTLISTNODER3;
#else
typedef struct { RTR3PTR aOffLimits[2]; } RTLISTNODER3;
#endif
/** Version of RTLISTANCHOR for holding a ring-3 only list in data which gets
* shared between multiple contexts */
typedef RTLISTNODER3 RTLISTANCHORR3;
/**
* Initialize a list.
......@@ -152,8 +163,8 @@ DECLINLINE(void) RTListNodeRemove(PRTLISTNODE pNode)
/**
* Checks if a node is the last element in the list.
*
* @retval @c true if the node is the last element in the list.
* @retval @c false otherwise
* @retval true if the node is the last element in the list.
* @retval false otherwise
*
* @param pList The list.
* @param pNode The node to check.
......@@ -163,8 +174,8 @@ DECLINLINE(void) RTListNodeRemove(PRTLISTNODE pNode)
/**
* Checks if a node is the first element in the list.
*
* @retval @c true if the node is the first element in the list.
* @retval @c false otherwise.
* @retval true if the node is the first element in the list.
* @retval false otherwise.
*
* @param pList The list.
* @param pNode The node to check.
......@@ -174,11 +185,11 @@ DECLINLINE(void) RTListNodeRemove(PRTLISTNODE pNode)
/**
* Checks if a type converted node is actually the dummy element (@a pList).
*
* @retval @c true if the node is the dummy element in the list.
* @retval @c false otherwise.
* @retval true if the node is the dummy element in the list.
* @retval false otherwise.
*
* @param pList The list.
* @param pNodeStruct The node structure to check. Typically
* @param pNode The node structure to check. Typically
* something obtained from RTListNodeGetNext() or
* RTListNodeGetPrev(). This is NOT a PRTLISTNODE
* but something that contains a RTLISTNODE member!
......@@ -194,8 +205,8 @@ DECLINLINE(void) RTListNodeRemove(PRTLISTNODE pNode)
/**
* Checks if a list is empty.
*
* @retval @c true if the list is empty.
* @retval @c false otherwise.
* @retval true if the list is empty.
* @retval false otherwise.
*
* @param pList The list to check.
*/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -46,8 +46,8 @@ RT_C_DECLS_BEGIN
* @returns VINF_SUCCESS on success, VERR_GETOPT_INVALID_ARGUMENT_FORMAT on
* failure.
*
* @param pszValue The value to convert.
* @param pAddr Where to store the result.
* @param pszAddr The address string to convert.
* @param pMacAddr Where to store the result.
*/
RTDECL(int) RTNetStrToMacAddr(const char *pszAddr, PRTMAC pMacAddr);
......@@ -69,6 +69,14 @@ typedef RTNETADDRIPV4 const *PCRTNETADDRIPV4;
*/
RTDECL(bool) RTNetIsIPv4AddrStr(const char *pcszAddr);
/**
* Tests if the given string is a wildcard IPv4 address.
*
* @returns boolean.
* @param pcszAddr String which may be an IPv4 address.
*/
RTDECL(bool) RTNetStrIsIPv4AddrAny(const char *pcszAddr);
/**
* Parses dotted-decimal IPv4 address into RTNETADDRIPV4 representation.
*
......@@ -112,6 +120,14 @@ typedef RTNETADDRIPV6 const *PCRTNETADDRIPV6;
*/
RTDECL(bool) RTNetIsIPv6AddrStr(const char *pszAddress);
/**
* Tests if the given string is a wildcard IPv6 address.
*
* @returns @c true if it is, @c false if not.
* @param pszAddress String which may be an IPv6 address.
*/
RTDECL(bool) RTNetStrIsIPv6AddrAny(const char *pszAddress);
/**
* Parses IPv6 address into RTNETADDRIPV6 representation.
*
......
......@@ -357,6 +357,21 @@ RTDECL(void) RTPathStripSuffix(char *pszPath);
*/
RTDECL(size_t) RTPathStripTrailingSlash(char *pszPath);
/**
* Ensures that the path has a trailing path separator such that file names can
* be appended without further work.
*
* This can be helpful when preparing for efficiently combining a directory path
* with the filenames returned by RTDirRead. The return value gives you the
* position at which you copy the RTDIRENTRY::szName to construct a valid path
* to it.
*
* @returns The length of the path, 0 on buffer overflow.
* @param pszPath The path.
* @param cbPath The length of the path buffer @a pszPath points to.
*/
RTDECL(size_t) RTPathEnsureTrailingSeparator(char *pszPath, size_t cbPath);
/**
* Changes all the slashes in the specified path to DOS style.
*
......@@ -585,7 +600,7 @@ RTDECL(int) RTPathCopyComponents(char *pszDst, size_t cbDst, const char *pszSrc,
*
* The first component is the root, volume or UNC specifier, if present. Use
* RTPATH_PROP_HAS_ROOT_SPEC() on RTPATHPARSED::fProps to determine its
* precense.
* presence.
*
* Other than the root component, no component will include directory separators
* (slashes).
......@@ -791,7 +806,7 @@ RTDECL(void) RTPathSplitFree(PRTPATHSPLIT pSplit);
* @retval VERR_BUFFER_OVERFLOW if @a cbDstPath is less than or equal to
* RTPATHSPLIT::cchPath.
*
* @param pParsed The parser output for @a pszSrcPath.
* @param pSplit A split path (see RTPathSplit, RTPathSplitA).
* @param fFlags Combination of RTPATH_STR_F_STYLE_XXX.
* Most users will pass 0.
* @param pszDstPath Pointer to the buffer where the path is to be
......@@ -1156,6 +1171,72 @@ RTDECL(int) RTPathAppDocs(char *pszPath, size_t cchPath);
*/
RTDECL(int) RTPathTemp(char *pszPath, size_t cchPath);
/**
* RTPathGlobl result entry.
*/
typedef struct RTPATHGLOBENTRY
{
/** List entry. */
struct RTPATHGLOBENTRY *pNext;
/** RTDIRENTRYTYPE value. */
uint8_t uType;
/** Unused explicit padding. */
uint8_t bUnused;
/** The length of the path. */
uint16_t cchPath;
/** The path to the file (variable length). */
char szPath[1];
} RTPATHGLOBENTRY;
/** Pointer to a GLOB result entry. */
typedef RTPATHGLOBENTRY *PRTPATHGLOBENTRY;
/** Pointer to a const GLOB result entry. */
typedef RTPATHGLOBENTRY const *PCRTPATHGLOBENTRY;
/** Pointer to a GLOB result entry pointer. */
typedef PCRTPATHGLOBENTRY *PPCRTPATHGLOBENTRY;
/**
* Performs wildcard expansion on a path pattern.
*
* @returns IPRT status code.
*
* @param pszPattern The pattern to expand.
* @param fFlags RTPATHGLOB_F_XXX.
* @param ppHead Where to return the head of the result list. This
* is always set to NULL on failure.
* @param pcResults Where to return the number of the result. Optional.
*/
RTDECL(int) RTPathGlob(const char *pszPattern, uint32_t fFlags, PPCRTPATHGLOBENTRY ppHead, uint32_t *pcResults);
/** @name RTPATHGLOB_F_XXX - RTPathGlob flags
* @{ */
/** Case insensitive. */
#define RTPATHGLOB_F_IGNORE_CASE RT_BIT_32(0)
/** Do not expand \${EnvOrSpecialVariable} in the pattern. */
#define RTPATHGLOB_F_NO_VARIABLES RT_BIT_32(1)
/** Do not interpret a leading tilde as a home directory reference. */
#define RTPATHGLOB_F_NO_TILDE RT_BIT_32(2)
/** Only return the first match. */
#define RTPATHGLOB_F_FIRST_ONLY RT_BIT_32(3)
/** Only match directories (implied if pattern ends with slash). */
#define RTPATHGLOB_F_ONLY_DIRS RT_BIT_32(4)
/** Do not match directories. (Can't be used with RTPATHGLOB_F_ONLY_DIRS or
* patterns containing a trailing slash.) */
#define RTPATHGLOB_F_NO_DIRS RT_BIT_32(5)
/** Disables the '**' wildcard pattern for matching zero or more subdirs. */
#define RTPATHGLOB_F_NO_STARSTAR RT_BIT_32(6)
/** Mask of valid flags. */
#define RTPATHGLOB_F_MASK UINT32_C(0x0000007f)
/** @} */
/**
* Frees the results produced by RTPathGlob.
*
* @param pHead What RTPathGlob returned. NULL ignored.
*/
RTDECL(void) RTPathGlobFree(PCRTPATHGLOBENTRY pHead);
/**
* Query information about a file system object.
*
......
......@@ -159,7 +159,7 @@ RTR3DECL(int) RTProcCreate(const char *pszExec, const char * const *papszArgs,
* guest.
* @param pszAsUser User to run the process as. Pass NULL to use the same
* user as the current process.
* Windows: Use user@domain format to specify a domain.
* Windows: Use user\@domain format to specify a domain.
* @param pszPassword Password to use to authenticate @a pszAsUser. Must be
* NULL wif pszAsUser is NULL. Whether this is actually
* used or not depends on the platform.
......@@ -186,7 +186,7 @@ RTR3DECL(int) RTProcCreateEx(const char *pszExec, const char * const *papszArg
* be possible to wait for it, i.e. @a phProcess shall be NULL. */
#define RTPROC_FLAGS_DETACHED RT_BIT(0)
/** Don't show the started process.
* This is a window (and maybe OS/2) concept, do not use on other platforms. */
* This is a Windows (and maybe OS/2) concept, do not use on other platforms. */
#define RTPROC_FLAGS_HIDDEN RT_BIT(1)
/** Use special code path for starting child processes from a service (daemon).
* This is a windows concept for dealing with the so called "Session 0"
......@@ -197,9 +197,13 @@ RTR3DECL(int) RTProcCreateEx(const char *pszExec, const char * const *papszArg
* on Solaris. Without this flag the contract id is always changed, as that's
* the more frequently used case. */
#define RTPROC_FLAGS_SAME_CONTRACT RT_BIT(3)
/** Do not load user profile data when executing a process.
* This bit at the moment only is valid on Windows. */
#define RTPROC_FLAGS_NO_PROFILE RT_BIT(4)
/** Load user profile data when executing a process.
* This redefines the meaning of RTENV_DEFAULT to the profile environment.
* @remarks On non-windows platforms, the resulting environment maybe very
* different from what you see in your shell. Among other reasons,
* we cannot run shell profile scripts which typically sets up the
* environment. */
#define RTPROC_FLAGS_PROFILE RT_BIT(4)
/** Create process without a console window.
* This is a Windows (and OS/2) concept, do not use on other platforms. */
#define RTPROC_FLAGS_NO_WINDOW RT_BIT(5)
......@@ -210,8 +214,11 @@ RTR3DECL(int) RTProcCreateEx(const char *pszExec, const char * const *papszArg
* just join up argv with a space between each. Ignored on platforms
* passing argument the vector. */
#define RTPROC_FLAGS_UNQUOTED_ARGS RT_BIT(7)
/** Consider hEnv an environment change record to be applied to RTENV_DEFAULT.
* If hEnv is RTENV_DEFAULT, the flag has no effect. */
#define RTPROC_FLAGS_ENV_CHANGE_RECORD RT_BIT(8)
/** Valid flag mask. */
#define RTPROC_FLAGS_VALID_MASK UINT32_C(0xff)
#define RTPROC_FLAGS_VALID_MASK UINT32_C(0x1ff)
/** @} */
......@@ -333,9 +340,9 @@ RTR3DECL(char *) RTProcGetExecutablePath(char *pszExecPath, size_t cbExecPath);
* @returns IPRT status code. On success it is normal for the caller to exit
* the process by returning from main().
*
* @param papszArgs The argument vector of the calling process.
* @param pszDaemonized The daemonized option. This is appended to the end
* of the parameter list of the daemonized process.
* @param papszArgs The argument vector of the calling process.
* @param pszDaemonizedOpt The daemonized option. This is appended to the
* end of the parameter list of the daemonized process.
*/
RTR3DECL(int) RTProcDaemonize(const char * const *papszArgs, const char *pszDaemonizedOpt);
......@@ -384,14 +391,14 @@ RTR3DECL(int) RTProcQueryParent(RTPROCESS hProcess, PRTPROCESS phParent);
* @returns IPRT status code.
* @retval VERR_BUFFER_OVERFLOW if the given buffer size is to small for the username.
* @param hProcess The process handle to query the username for.
* NIL_PROCESS is an alias for the current process.
* @param pszUser Where to store the user name on success.
* @param cbUser The size of the user name buffer.
* @param pcbUser Where to store the username length on success
* or the required buffer size if VERR_BUFFER_OVERFLOW
* is returned.
*/
RTR3DECL(int) RTProcQueryUsername(RTPROCESS hProcess, char *pszUser, size_t cbUser,
size_t *pcbUser);
RTR3DECL(int) RTProcQueryUsername(RTPROCESS hProcess, char *pszUser, size_t cbUser, size_t *pcbUser);
/**
* Query the username of the given process allocating the string for the username.
......
This diff is collapsed.
This diff is collapsed.
......@@ -298,7 +298,7 @@ typedef DECLCALLBACKPTR(int, PFNRTTHREADCREATE)(PRTTHREAD pThread, PFNRTTHREAD p
* @param va Format arguments.
*/
RTDECL(int) RTThreadCreateV(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack,
RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, va_list va);
RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, va_list va) RT_IPRT_FORMAT_ATTR(7, 0);
/**
* Create a new thread.
......@@ -316,7 +316,7 @@ RTDECL(int) RTThreadCreateV(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUs
* @param ... Format arguments.
*/
RTDECL(int) RTThreadCreateF(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack,
RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, ...);
RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, ...) RT_IPRT_FORMAT_ATTR(7, 8);
/**
* Gets the native thread id of a IPRT thread.
......
......@@ -70,7 +70,7 @@ RT_C_DECLS_END
# endif
# include <sys/types.h>
# ifndef offsetof
# error "offsetof is not defined..."
# error "offsetof is not defined!"
# endif
# elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86)
......@@ -2174,6 +2174,21 @@ typedef RTUTF16 *PRTUTF16;
typedef const RTUTF16 *PCRTUTF16;
/**
* String tuple to go with the RT_STR_TUPLE macro.
*/
typedef struct RTSTRTUPLE
{
/** The string. */
const char *psz;
/** The string length. */
size_t cch;
} RTSTRTUPLE;
/** Pointer to a string tuple. */
typedef RTSTRTUPLE *PRTSTRTUPLE;
/** Pointer to a const string tuple. */
typedef RTSTRTUPLE const *PCRTSTRTUPLE;
/**
* Wait for ever if we have to.
*/
......@@ -2198,7 +2213,7 @@ typedef FNRTPROGRESS *PFNRTPROGRESS;
* @param pszFormat The format string.
* @param va Arguments for the format string.
*/
typedef DECLCALLBACK(void) FNRTDUMPPRINTFV(void *pvUser, const char *pszFormat, va_list va);
typedef DECLCALLBACK(void) FNRTDUMPPRINTFV(void *pvUser, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(2, 0);
/** Pointer to a generic printf-like function for dumping. */
typedef FNRTDUMPPRINTFV *PFNRTDUMPPRINTFV;
......@@ -2415,7 +2430,7 @@ typedef const RTRANGE *PCRTRANGE;
*/
typedef union RTPTRUNION
{
/** Pointer into the void... */
/** Pointer into the void. */
void *pv;
/** As a signed integer. */
intptr_t i;
......@@ -2454,7 +2469,7 @@ typedef RTPTRUNION *PRTPTRUNION;
*/
typedef union RTCPTRUNION
{
/** Pointer into the void... */
/** Pointer into the void. */
void const *pv;
/** As a signed integer. */
intptr_t i;
......@@ -2493,7 +2508,7 @@ typedef RTCPTRUNION *PRTCPTRUNION;
*/
typedef union RTVPTRUNION
{
/** Pointer into the void... */
/** Pointer into the void. */
void volatile *pv;
/** As a signed integer. */
intptr_t i;
......@@ -2532,7 +2547,7 @@ typedef RTVPTRUNION *PRTVPTRUNION;
*/
typedef union RTCVPTRUNION
{
/** Pointer into the void... */
/** Pointer into the void. */
void const volatile *pv;
/** As a signed integer. */
intptr_t i;
......
This diff is collapsed.
......@@ -1069,6 +1069,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00040000)) == 0);
/** BIOS update signature (microcode). */
#define MSR_IA32_BIOS_SIGN_ID 0x8B
/** SMM monitor control. */
#define MSR_IA32_SMM_MONITOR_CTL 0x9B
/** General performance counter no. 0. */
#define MSR_IA32_PMC0 0xC1
/** General performance counter no. 1. */
......
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
......@@ -45,9 +45,9 @@
#include "r0drv/alloc-r0drv.h"
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/*********************************************************************************************************************************
* Defined Constants And Macros *
*********************************************************************************************************************************/
#ifdef RT_STRICT
# define RTR0MEM_STRICT
#endif
......@@ -59,9 +59,9 @@
#endif
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/*********************************************************************************************************************************
* Global Variables *
*********************************************************************************************************************************/
#ifdef RTR0MEM_STRICT
/** Fence data. */
static uint8_t const g_abFence[RTR0MEM_FENCE_EXTRA] =
......@@ -89,21 +89,21 @@ DECLINLINE(PRTMEMHDR) rtR0MemAlloc(size_t cb, uint32_t fFlags)
}
RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocTag(cb, pszTag);
}
RT_EXPORT_SYMBOL(RTMemTmpAllocTag);
RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocZTag(cb, pszTag);
}
RT_EXPORT_SYMBOL(RTMemTmpAllocZTag);
RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW
RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW_DEF
{
return RTMemFree(pv);
}
......@@ -113,7 +113,7 @@ RT_EXPORT_SYMBOL(RTMemTmpFree);
RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
......@@ -132,7 +132,7 @@ RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemAllocTag);
RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
......@@ -177,7 +177,7 @@ RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag)
RT_EXPORT_SYMBOL(RTMemAllocZVarTag);
RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdrOld;
......@@ -243,7 +243,7 @@ RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT
RT_EXPORT_SYMBOL(RTMemReallocTag);
RTDECL(void) RTMemFree(void *pv) RT_NO_THROW
RTDECL(void) RTMemFree(void *pv) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
......@@ -276,7 +276,7 @@ RT_EXPORT_SYMBOL(RTMemFree);
RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
#ifdef RT_OS_SOLARIS /** @todo figure out why */
......@@ -299,7 +299,7 @@ RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemExecAllocTag);
RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW
RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
......@@ -329,7 +329,7 @@ RT_EXPORT_SYMBOL(RTMemExecFree);
RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW
RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW_DEF
{
uint32_t fHdrFlags = RTMEMHDR_FLAG_ALLOC_EX;
PRTMEMHDR pHdr;
......@@ -393,7 +393,7 @@ RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, cons
RT_EXPORT_SYMBOL(RTMemAllocExTag);
RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW
RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
......
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include "../nt/the-nt-kernel.h"
#endif
......@@ -43,9 +43,9 @@
#include "internal/magics.h"
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/*********************************************************************************************************************************
* Structures and Typedefs *
*********************************************************************************************************************************/
/**
* Saved state information.
*/
......@@ -85,9 +85,9 @@ typedef struct RTSEMSPINMUTEXINTERNAL
} RTSEMSPINMUTEXINTERNAL;
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/*********************************************************************************************************************************
* Defined Constants And Macros *
*********************************************************************************************************************************/
/*#define RTSEMSPINMUTEX_INT_FLAGS_MUST*/
/** Validates the handle, returning if invalid. */
......
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include "internal/iprt.h"
......@@ -45,9 +45,9 @@
#include "internal/thread.h"
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/*********************************************************************************************************************************
* Global Variables *
*********************************************************************************************************************************/
/** Count of current IPRT users.
* In ring-0 several drivers / kmods / kexts / wossnames may share the
* same runtime code. So, we need to keep count in order not to terminate
......
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
......@@ -35,7 +35,9 @@
RTDECL(void) RTLogWriteDebugger(const char *pch, size_t cb)
{
IPRT_LINUX_SAVE_EFL_AC();
printk("%.*s", (int)cb, pch);
IPRT_LINUX_RESTORE_EFL_AC();
}
RT_EXPORT_SYMBOL(RTLogWriteDebugger);
This diff is collapsed.
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
......@@ -42,23 +42,27 @@
DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
{
IPRT_LINUX_SAVE_EFL_AC();
printk(KERN_EMERG
"\r\n!!Assertion Failed!!\r\n"
"Expression: %s\r\n"
"Location : %s(%d) %s\r\n",
pszExpr, pszFile, uLine, pszFunction);
IPRT_LINUX_RESTORE_EFL_AC();
}
DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va)
{
char szMsg[256];
IPRT_LINUX_SAVE_EFL_AC();
RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
szMsg[sizeof(szMsg) - 1] = '\0';
printk(KERN_EMERG "%s", szMsg);
NOREF(fInitial);
IPRT_LINUX_RESTORE_EFL_AC();
}
......
This diff is collapsed.
......@@ -25,9 +25,9 @@
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment