2 * Copyright (c) 2019-2019 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
31 #include <libkern/c++/OSObject.h>
35 #ifndef _IOKIT_UOSOBJECT_H
36 #define _IOKIT_UOSOBJECT_H
41 #include <DriverKit/IOReturn.h>
43 #include <mach/port.h>
47 #include <DriverKit/OSMetaClass.h>
50 typedef OSObject * OSObjectPtr;
53 #if __IIG && !__IIG_ATTRIBUTES_DEFINED__
55 #define __IIG_ATTRIBUTES_DEFINED__ 1
57 #define KERNEL __attribute__((annotate("kernel")))
58 #define NATIVE __attribute__((annotate("native")))
59 #define LOCAL __attribute__((annotate("local")))
60 #define LOCALONLY __attribute__((annotate("localonly")))
61 #define REMOTE __attribute__((annotate("remote")))
63 #define LOCALHOST __attribute__((annotate("localhost")))
65 #define INVOKEREPLY __attribute__((annotate("invokereply")))
66 #define REPLY __attribute__((annotate("reply")))
68 #define PORTMAKESEND __attribute__((annotate("MACH_MSG_TYPE_MAKE_SEND")))
69 #define PORTCOPYSEND __attribute__((annotate("MACH_MSG_TYPE_COPY_SEND")))
71 #define TARGET __attribute__((annotate("target")))
72 #define TYPE(p) __attribute__((annotate("type=" # p)))
74 //#define ARRAY(maxcount) __attribute__((annotate(# maxcount), annotate("array")))
75 #define EXTENDS(cls) __attribute__((annotate("extends=" # cls)))
77 //#define INTERFACE __attribute__((annotate("interface")))
78 //#define IMPLEMENTS(i) void implements(i *);
80 #define QUEUENAME(name) __attribute__((annotate("queuename=" # name)))
82 #define IIG_SERIALIZABLE __attribute__((annotate("serializable")))
86 #define IIG_SERIALIZABLE
93 typedef OSObject OSContainer;
95 class IIG_SERIALIZABLE OSContainer;
98 class IIG_SERIALIZABLE OSContainer;
101 class IIG_SERIALIZABLE OSData;
102 class IIG_SERIALIZABLE OSNumber;
103 class IIG_SERIALIZABLE OSString;
104 class IIG_SERIALIZABLE OSBoolean;
105 class IIG_SERIALIZABLE OSDictionary;
106 class IIG_SERIALIZABLE OSArray;
109 class IODispatchQueue;
110 typedef char IODispatchQueueName[256];
113 class OSMetaClassBase
115 virtual const OSMetaClass *
116 getMetaClass() const LOCALONLY;
119 retain() const LOCALONLY;
122 release() const LOCALONLY;
125 isEqualTo(const OSMetaClassBase * anObject) const LOCALONLY;
132 #include <DriverKit/IODispatchQueue.h>
136 class OSObject : public OSMetaClassBase
147 retain() const override;
150 release() const override;
152 virtual kern_return_t
154 const IODispatchQueueName name,
155 IODispatchQueue * queue) KERNEL = 0;
157 virtual kern_return_t
159 const IODispatchQueueName name,
160 IODispatchQueue ** queue) KERNEL = 0;
163 #define DEFN(classname, name) \
164 name ## _Impl(classname ## _ ## name ## _Args)
166 #define IMPL(classname, name) \
167 classname :: DEFN(classname, name)
169 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
171 #endif /* ! _IOKIT_UOSOBJECT_H */