xref: /xnu-10063.121.3/libkern/os/firehose.h (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1 /*
2  * Copyright (c) 2015 Apple Inc. All rights reserved.
3  *
4  * @APPLE_LICENSE_HEADER_START@
5  *
6  * This file contains Original Code and/or Modifications of Original Code
7  * as defined in and that are subject to the Apple Public Source License
8  * Version 2.0 (the 'License'). You may not use this file except in
9  * compliance with the License. Please obtain a copy of the License at
10  * http://www.opensource.apple.com/apsl/ and read it before using this
11  * file.
12  *
13  * The Original Code and all software distributed under the License are
14  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18  * Please see the License for the specific language governing rights and
19  * limitations under the License.
20  *
21  * @APPLE_LICENSE_HEADER_END@
22  */
23 
24 #ifndef __firehose_h
25 #define __firehose_h
26 
27 __BEGIN_DECLS
28 
29 /*!
30  * @function __firehose_buffer_push_to_logd
31  *
32  * @abstract
33  * Called by the dispatch firehose apis to notify logd that a chunk is available
34  */
35 __WATCHOS_AVAILABLE(3.0) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0)
36 void __firehose_buffer_push_to_logd(firehose_buffer_t fb, bool for_io);
37 
38 /*!
39  * @function __firehose_allocate
40  *
41  * @abstract
42  * Wrapper to allocate kernel memory
43  */
44 __WATCHOS_AVAILABLE(3.0) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0)
45 void __firehose_allocate(vm_offset_t *addr, vm_size_t size);
46 
47 /*!
48  * @function __firehose_critical_region_enter
49  *
50  * @abstract
51  * Function that disables preemption
52  */
53 __WATCHOS_AVAILABLE(3.0) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0)
54 extern void __firehose_critical_region_enter(void);
55 
56 /*!
57  * @function __firehose_critical_region_leave
58  *
59  * @abstract
60  * Function that enables preemption
61  */
62 __WATCHOS_AVAILABLE(3.0) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0)
63 extern void __firehose_critical_region_leave(void);
64 
65 extern void oslogwakeup(void);
66 
67 __END_DECLS
68 
69 #endif /* __firehose_h */
70