include/linux/vbox_utils.h
Source file repositories/reference/linux-study-clean/include/linux/vbox_utils.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/vbox_utils.h- Extension
.h- Size
- 1790 bytes
- Lines
- 60
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/printk.hlinux/vbox_vmmdev_types.h
Detected Declarations
struct vbg_dev
Annotated Snippet
#ifndef __VBOX_UTILS_H__
#define __VBOX_UTILS_H__
#include <linux/printk.h>
#include <linux/vbox_vmmdev_types.h>
struct vbg_dev;
/**
* vboxguest logging functions, these log both to the backdoor and call
* the equivalent kernel pr_foo function.
*/
__printf(1, 2) void vbg_info(const char *fmt, ...);
__printf(1, 2) void vbg_warn(const char *fmt, ...);
__printf(1, 2) void vbg_err(const char *fmt, ...);
__printf(1, 2) void vbg_err_ratelimited(const char *fmt, ...);
/* Only use backdoor logging for non-dynamic debug builds */
#if defined(DEBUG) && !defined(CONFIG_DYNAMIC_DEBUG)
__printf(1, 2) void vbg_debug(const char *fmt, ...);
#else
#define vbg_debug pr_debug
#endif
int vbg_hgcm_connect(struct vbg_dev *gdev, u32 requestor,
struct vmmdev_hgcm_service_location *loc,
u32 *client_id, int *vbox_status);
int vbg_hgcm_disconnect(struct vbg_dev *gdev, u32 requestor,
u32 client_id, int *vbox_status);
int vbg_hgcm_call(struct vbg_dev *gdev, u32 requestor, u32 client_id,
u32 function, u32 timeout_ms,
struct vmmdev_hgcm_function_parameter *parms, u32 parm_count,
int *vbox_status);
/**
* Convert a VirtualBox status code to a standard Linux kernel return value.
* Return: 0 or negative errno value.
* @rc: VirtualBox status code to convert.
*/
int vbg_status_code_to_errno(int rc);
/**
* Helper for the vboxsf driver to get a reference to the guest device.
* Return: a pointer to the gdev; or a ERR_PTR value on error.
*/
struct vbg_dev *vbg_get_gdev(void);
/**
* Helper for the vboxsf driver to put a guest device reference.
* @gdev: Reference returned by vbg_get_gdev to put.
*/
void vbg_put_gdev(struct vbg_dev *gdev);
#endif
Annotation
- Immediate include surface: `linux/printk.h`, `linux/vbox_vmmdev_types.h`.
- Detected declarations: `struct vbg_dev`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.