VirtualBox

source: vbox/trunk/src/recompiler/osdep.h@ 1005

最後變更 在這個檔案從1005是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.9 KB
 
1#ifndef QEMU_OSDEP_H
2#define QEMU_OSDEP_H
3
4#if defined(VBOX)
5
6#include <iprt/alloc.h>
7#include <iprt/string.h>
8
9#define qemu_vsnprintf(pszBuf, cchBuf, pszFormat, args) \
10 RTStrPrintfV((pszBuf), (cchBuf), (pszFormat), (args))
11#define qemu_vprintf(pszFormat, args) \
12 RTLogPrintfV((pszFormat), (args))
13#define qemu_printf RTLogPrintf
14#define qemu_malloc(cb) RTMemAlloc(cb)
15#define qemu_mallocz(cb) RTMemAllocZ(cb)
16#define qemu_free(pv) RTMemFree(pv)
17#define qemu_strdup(psz) RTStrDup(psz)
18
19
20#else /* !VBOX */
21
22#include <stdarg.h>
23
24int qemu_vsnprintf(char *buf, int buflen, const char *fmt, va_list args);
25void qemu_vprintf(const char *fmt, va_list ap);
26void qemu_printf(const char *fmt, ...);
27
28void *qemu_malloc(size_t size);
29void *qemu_mallocz(size_t size);
30void qemu_free(void *ptr);
31char *qemu_strdup(const char *str);
32
33void *get_mmap_addr(unsigned long size);
34
35/* specific kludges for OS compatibility (should be moved elsewhere) */
36#if defined(__i386__) && !defined(CONFIG_SOFTMMU) && !defined(CONFIG_USER_ONLY)
37
38/* disabled pthread version of longjmp which prevent us from using an
39 alternative signal stack */
40extern void __longjmp(jmp_buf env, int val);
41#define longjmp __longjmp
42
43#include <signal.h>
44
45/* NOTE: it works only because the glibc sigset_t is >= kernel sigset_t */
46struct qemu_sigaction {
47 union {
48 void (*_sa_handler)(int);
49 void (*_sa_sigaction)(int, struct siginfo *, void *);
50 } _u;
51 unsigned long sa_flags;
52 void (*sa_restorer)(void);
53 sigset_t sa_mask; /* mask last for extensibility */
54};
55
56int qemu_sigaction(int signum, const struct qemu_sigaction *act,
57 struct qemu_sigaction *oldact);
58
59#undef sigaction
60#undef sa_handler
61#undef sa_sigaction
62#define sigaction qemu_sigaction
63#define sa_handler _u._sa_handler
64#define sa_sigaction _u._sa_sigaction
65
66#endif
67
68#endif /* !VBOX */
69
70#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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