1 | /** @file
|
---|
2 | * VBox Host Guest Shared Memory Interface (HGSMI) buffer management.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2017 Oracle Corporation
|
---|
7 | *
|
---|
8 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
9 | * copy of this software and associated documentation files (the "Software"),
|
---|
10 | * to deal in the Software without restriction, including without limitation
|
---|
11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
12 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
13 | * Software is furnished to do so, subject to the following conditions:
|
---|
14 | *
|
---|
15 | * The above copyright notice and this permission notice shall be included in
|
---|
16 | * all copies or substantial portions of the Software.
|
---|
17 | *
|
---|
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
21 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
22 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
23 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
24 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef ___VBox_Graphics_HGSMIBase_h___
|
---|
28 | #define ___VBox_Graphics_HGSMIBase_h___
|
---|
29 |
|
---|
30 | #include <VBoxVideoIPRT.h>
|
---|
31 | #include <HGSMIDefs.h>
|
---|
32 | #include <HGSMIChannels.h>
|
---|
33 | #include <HGSMIChSetup.h>
|
---|
34 | #include <linux/genalloc.h>
|
---|
35 |
|
---|
36 | typedef struct gen_pool *PHGSMIGUESTCOMMANDCONTEXT;
|
---|
37 |
|
---|
38 | void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size,
|
---|
39 | u8 channel, u16 channel_info);
|
---|
40 | void hgsmi_buffer_free(struct gen_pool *guest_pool, void *buf);
|
---|
41 | int hgsmi_buffer_submit(struct gen_pool *guest_pool, void *buf);
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * Translate CamelCase names used in osindependent code to standard
|
---|
45 | * kernel style names.
|
---|
46 | */
|
---|
47 | #define VBoxHGSMIBufferAlloc(ctx, size, ch, ch_info) \
|
---|
48 | hgsmi_buffer_alloc(ctx, size, ch, ch_info)
|
---|
49 | #define VBoxHGSMIBufferFree(ctx, buf) hgsmi_buffer_free(ctx, buf)
|
---|
50 | #define VBoxHGSMIBufferSubmit(ctx, buf) hgsmi_buffer_submit(ctx, buf)
|
---|
51 |
|
---|
52 | #endif
|
---|