| 1 | /* iig(DriverKit-286 Mar 29 2024 10:27:09) generated from IOExtensiblePaniclog.iig */ |
| 2 | |
| 3 | #undef IIG_IMPLEMENTATION |
| 4 | #define IIG_IMPLEMENTATION IOExtensiblePaniclog.iig |
| 5 | |
| 6 | #if KERNEL |
| 7 | #include <libkern/c++/OSString.h> |
| 8 | #else |
| 9 | #include <DriverKit/DriverKit.h> |
| 10 | #endif /* KERNEL */ |
| 11 | #include <DriverKit/IOReturn.h> |
| 12 | #include <DriverKit/IOExtensiblePaniclog.h> |
| 13 | |
| 14 | |
| 15 | #if __has_builtin(__builtin_load_member_function_pointer) |
| 16 | #define SimpleMemberFunctionCast(cfnty, self, func) (cfnty)__builtin_load_member_function_pointer(self, func) |
| 17 | #else |
| 18 | #define SimpleMemberFunctionCast(cfnty, self, func) ({ union { typeof(func) memfun; cfnty cfun; } pair; pair.memfun = func; pair.cfun; }) |
| 19 | #endif |
| 20 | |
| 21 | |
| 22 | struct IOExtensiblePaniclog_Create_Msg_Content |
| 23 | { |
| 24 | IORPCMessage __hdr; |
| 25 | OSObjectRef __object; |
| 26 | OSData * uuid; |
| 27 | #if !defined(__LP64__) |
| 28 | uint32_t __uuidPad; |
| 29 | #endif /* !defined(__LP64__) */ |
| 30 | OSString * data_id; |
| 31 | #if !defined(__LP64__) |
| 32 | uint32_t __data_idPad; |
| 33 | #endif /* !defined(__LP64__) */ |
| 34 | uint32_t max_len; |
| 35 | uint32_t options; |
| 36 | }; |
| 37 | #pragma pack(4) |
| 38 | struct IOExtensiblePaniclog_Create_Msg |
| 39 | { |
| 40 | IORPCMessageMach mach; |
| 41 | mach_msg_port_descriptor_t __object__descriptor; |
| 42 | mach_msg_ool_descriptor_t uuid__descriptor; |
| 43 | mach_msg_ool_descriptor_t data_id__descriptor; |
| 44 | IOExtensiblePaniclog_Create_Msg_Content content; |
| 45 | }; |
| 46 | #pragma pack() |
| 47 | #define IOExtensiblePaniclog_Create_Msg_ObjRefs (3) |
| 48 | |
| 49 | struct IOExtensiblePaniclog_Create_Rpl_Content |
| 50 | { |
| 51 | IORPCMessage __hdr; |
| 52 | OSObjectRef out; |
| 53 | }; |
| 54 | #pragma pack(4) |
| 55 | struct IOExtensiblePaniclog_Create_Rpl |
| 56 | { |
| 57 | IORPCMessageMach mach; |
| 58 | mach_msg_port_descriptor_t out__descriptor; |
| 59 | IOExtensiblePaniclog_Create_Rpl_Content content; |
| 60 | }; |
| 61 | #pragma pack() |
| 62 | #define IOExtensiblePaniclog_Create_Rpl_ObjRefs (1) |
| 63 | |
| 64 | |
| 65 | typedef union |
| 66 | { |
| 67 | const IORPC rpc; |
| 68 | struct |
| 69 | { |
| 70 | const struct IOExtensiblePaniclog_Create_Msg * message; |
| 71 | struct IOExtensiblePaniclog_Create_Rpl * reply; |
| 72 | uint32_t sendSize; |
| 73 | uint32_t replySize; |
| 74 | }; |
| 75 | } |
| 76 | IOExtensiblePaniclog_Create_Invocation; |
| 77 | struct IOExtensiblePaniclog_SetActive_Msg_Content |
| 78 | { |
| 79 | IORPCMessage __hdr; |
| 80 | OSObjectRef __object; |
| 81 | }; |
| 82 | #pragma pack(4) |
| 83 | struct IOExtensiblePaniclog_SetActive_Msg |
| 84 | { |
| 85 | IORPCMessageMach mach; |
| 86 | mach_msg_port_descriptor_t __object__descriptor; |
| 87 | IOExtensiblePaniclog_SetActive_Msg_Content content; |
| 88 | }; |
| 89 | #pragma pack() |
| 90 | #define IOExtensiblePaniclog_SetActive_Msg_ObjRefs (1) |
| 91 | |
| 92 | struct IOExtensiblePaniclog_SetActive_Rpl_Content |
| 93 | { |
| 94 | IORPCMessage __hdr; |
| 95 | }; |
| 96 | #pragma pack(4) |
| 97 | struct IOExtensiblePaniclog_SetActive_Rpl |
| 98 | { |
| 99 | IORPCMessageMach mach; |
| 100 | IOExtensiblePaniclog_SetActive_Rpl_Content content; |
| 101 | }; |
| 102 | #pragma pack() |
| 103 | #define IOExtensiblePaniclog_SetActive_Rpl_ObjRefs (0) |
| 104 | |
| 105 | |
| 106 | typedef union |
| 107 | { |
| 108 | const IORPC rpc; |
| 109 | struct |
| 110 | { |
| 111 | const struct IOExtensiblePaniclog_SetActive_Msg * message; |
| 112 | struct IOExtensiblePaniclog_SetActive_Rpl * reply; |
| 113 | uint32_t sendSize; |
| 114 | uint32_t replySize; |
| 115 | }; |
| 116 | } |
| 117 | IOExtensiblePaniclog_SetActive_Invocation; |
| 118 | struct IOExtensiblePaniclog_SetInactive_Msg_Content |
| 119 | { |
| 120 | IORPCMessage __hdr; |
| 121 | OSObjectRef __object; |
| 122 | }; |
| 123 | #pragma pack(4) |
| 124 | struct IOExtensiblePaniclog_SetInactive_Msg |
| 125 | { |
| 126 | IORPCMessageMach mach; |
| 127 | mach_msg_port_descriptor_t __object__descriptor; |
| 128 | IOExtensiblePaniclog_SetInactive_Msg_Content content; |
| 129 | }; |
| 130 | #pragma pack() |
| 131 | #define IOExtensiblePaniclog_SetInactive_Msg_ObjRefs (1) |
| 132 | |
| 133 | struct IOExtensiblePaniclog_SetInactive_Rpl_Content |
| 134 | { |
| 135 | IORPCMessage __hdr; |
| 136 | }; |
| 137 | #pragma pack(4) |
| 138 | struct IOExtensiblePaniclog_SetInactive_Rpl |
| 139 | { |
| 140 | IORPCMessageMach mach; |
| 141 | IOExtensiblePaniclog_SetInactive_Rpl_Content content; |
| 142 | }; |
| 143 | #pragma pack() |
| 144 | #define IOExtensiblePaniclog_SetInactive_Rpl_ObjRefs (0) |
| 145 | |
| 146 | |
| 147 | typedef union |
| 148 | { |
| 149 | const IORPC rpc; |
| 150 | struct |
| 151 | { |
| 152 | const struct IOExtensiblePaniclog_SetInactive_Msg * message; |
| 153 | struct IOExtensiblePaniclog_SetInactive_Rpl * reply; |
| 154 | uint32_t sendSize; |
| 155 | uint32_t replySize; |
| 156 | }; |
| 157 | } |
| 158 | IOExtensiblePaniclog_SetInactive_Invocation; |
| 159 | struct IOExtensiblePaniclog_InsertData_Msg_Content |
| 160 | { |
| 161 | IORPCMessage __hdr; |
| 162 | OSObjectRef __object; |
| 163 | OSData * data; |
| 164 | #if !defined(__LP64__) |
| 165 | uint32_t __dataPad; |
| 166 | #endif /* !defined(__LP64__) */ |
| 167 | }; |
| 168 | #pragma pack(4) |
| 169 | struct IOExtensiblePaniclog_InsertData_Msg |
| 170 | { |
| 171 | IORPCMessageMach mach; |
| 172 | mach_msg_port_descriptor_t __object__descriptor; |
| 173 | mach_msg_ool_descriptor_t data__descriptor; |
| 174 | IOExtensiblePaniclog_InsertData_Msg_Content content; |
| 175 | }; |
| 176 | #pragma pack() |
| 177 | #define IOExtensiblePaniclog_InsertData_Msg_ObjRefs (2) |
| 178 | |
| 179 | struct IOExtensiblePaniclog_InsertData_Rpl_Content |
| 180 | { |
| 181 | IORPCMessage __hdr; |
| 182 | }; |
| 183 | #pragma pack(4) |
| 184 | struct IOExtensiblePaniclog_InsertData_Rpl |
| 185 | { |
| 186 | IORPCMessageMach mach; |
| 187 | IOExtensiblePaniclog_InsertData_Rpl_Content content; |
| 188 | }; |
| 189 | #pragma pack() |
| 190 | #define IOExtensiblePaniclog_InsertData_Rpl_ObjRefs (0) |
| 191 | |
| 192 | |
| 193 | typedef union |
| 194 | { |
| 195 | const IORPC rpc; |
| 196 | struct |
| 197 | { |
| 198 | const struct IOExtensiblePaniclog_InsertData_Msg * message; |
| 199 | struct IOExtensiblePaniclog_InsertData_Rpl * reply; |
| 200 | uint32_t sendSize; |
| 201 | uint32_t replySize; |
| 202 | }; |
| 203 | } |
| 204 | IOExtensiblePaniclog_InsertData_Invocation; |
| 205 | struct IOExtensiblePaniclog_AppendData_Msg_Content |
| 206 | { |
| 207 | IORPCMessage __hdr; |
| 208 | OSObjectRef __object; |
| 209 | OSData * data; |
| 210 | #if !defined(__LP64__) |
| 211 | uint32_t __dataPad; |
| 212 | #endif /* !defined(__LP64__) */ |
| 213 | }; |
| 214 | #pragma pack(4) |
| 215 | struct IOExtensiblePaniclog_AppendData_Msg |
| 216 | { |
| 217 | IORPCMessageMach mach; |
| 218 | mach_msg_port_descriptor_t __object__descriptor; |
| 219 | mach_msg_ool_descriptor_t data__descriptor; |
| 220 | IOExtensiblePaniclog_AppendData_Msg_Content content; |
| 221 | }; |
| 222 | #pragma pack() |
| 223 | #define IOExtensiblePaniclog_AppendData_Msg_ObjRefs (2) |
| 224 | |
| 225 | struct IOExtensiblePaniclog_AppendData_Rpl_Content |
| 226 | { |
| 227 | IORPCMessage __hdr; |
| 228 | }; |
| 229 | #pragma pack(4) |
| 230 | struct IOExtensiblePaniclog_AppendData_Rpl |
| 231 | { |
| 232 | IORPCMessageMach mach; |
| 233 | IOExtensiblePaniclog_AppendData_Rpl_Content content; |
| 234 | }; |
| 235 | #pragma pack() |
| 236 | #define IOExtensiblePaniclog_AppendData_Rpl_ObjRefs (0) |
| 237 | |
| 238 | |
| 239 | typedef union |
| 240 | { |
| 241 | const IORPC rpc; |
| 242 | struct |
| 243 | { |
| 244 | const struct IOExtensiblePaniclog_AppendData_Msg * message; |
| 245 | struct IOExtensiblePaniclog_AppendData_Rpl * reply; |
| 246 | uint32_t sendSize; |
| 247 | uint32_t replySize; |
| 248 | }; |
| 249 | } |
| 250 | IOExtensiblePaniclog_AppendData_Invocation; |
| 251 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Msg_Content |
| 252 | { |
| 253 | IORPCMessage __hdr; |
| 254 | OSObjectRef __object; |
| 255 | }; |
| 256 | #pragma pack(4) |
| 257 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Msg |
| 258 | { |
| 259 | IORPCMessageMach mach; |
| 260 | mach_msg_port_descriptor_t __object__descriptor; |
| 261 | IOExtensiblePaniclog_CopyMemoryDescriptor_Msg_Content content; |
| 262 | }; |
| 263 | #pragma pack() |
| 264 | #define IOExtensiblePaniclog_CopyMemoryDescriptor_Msg_ObjRefs (1) |
| 265 | |
| 266 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl_Content |
| 267 | { |
| 268 | IORPCMessage __hdr; |
| 269 | OSObjectRef mem; |
| 270 | }; |
| 271 | #pragma pack(4) |
| 272 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl |
| 273 | { |
| 274 | IORPCMessageMach mach; |
| 275 | mach_msg_port_descriptor_t mem__descriptor; |
| 276 | IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl_Content content; |
| 277 | }; |
| 278 | #pragma pack() |
| 279 | #define IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl_ObjRefs (1) |
| 280 | |
| 281 | |
| 282 | typedef union |
| 283 | { |
| 284 | const IORPC rpc; |
| 285 | struct |
| 286 | { |
| 287 | const struct IOExtensiblePaniclog_CopyMemoryDescriptor_Msg * message; |
| 288 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl * reply; |
| 289 | uint32_t sendSize; |
| 290 | uint32_t replySize; |
| 291 | }; |
| 292 | } |
| 293 | IOExtensiblePaniclog_CopyMemoryDescriptor_Invocation; |
| 294 | struct IOExtensiblePaniclog_SetUsedLen_Msg_Content |
| 295 | { |
| 296 | IORPCMessage __hdr; |
| 297 | OSObjectRef __object; |
| 298 | uint32_t used_len; |
| 299 | }; |
| 300 | #pragma pack(4) |
| 301 | struct IOExtensiblePaniclog_SetUsedLen_Msg |
| 302 | { |
| 303 | IORPCMessageMach mach; |
| 304 | mach_msg_port_descriptor_t __object__descriptor; |
| 305 | IOExtensiblePaniclog_SetUsedLen_Msg_Content content; |
| 306 | }; |
| 307 | #pragma pack() |
| 308 | #define IOExtensiblePaniclog_SetUsedLen_Msg_ObjRefs (1) |
| 309 | |
| 310 | struct IOExtensiblePaniclog_SetUsedLen_Rpl_Content |
| 311 | { |
| 312 | IORPCMessage __hdr; |
| 313 | }; |
| 314 | #pragma pack(4) |
| 315 | struct IOExtensiblePaniclog_SetUsedLen_Rpl |
| 316 | { |
| 317 | IORPCMessageMach mach; |
| 318 | IOExtensiblePaniclog_SetUsedLen_Rpl_Content content; |
| 319 | }; |
| 320 | #pragma pack() |
| 321 | #define IOExtensiblePaniclog_SetUsedLen_Rpl_ObjRefs (0) |
| 322 | |
| 323 | |
| 324 | typedef union |
| 325 | { |
| 326 | const IORPC rpc; |
| 327 | struct |
| 328 | { |
| 329 | const struct IOExtensiblePaniclog_SetUsedLen_Msg * message; |
| 330 | struct IOExtensiblePaniclog_SetUsedLen_Rpl * reply; |
| 331 | uint32_t sendSize; |
| 332 | uint32_t replySize; |
| 333 | }; |
| 334 | } |
| 335 | IOExtensiblePaniclog_SetUsedLen_Invocation; |
| 336 | #if !KERNEL |
| 337 | extern OSMetaClass * gOSContainerMetaClass; |
| 338 | extern OSMetaClass * gOSDataMetaClass; |
| 339 | extern OSMetaClass * gOSNumberMetaClass; |
| 340 | extern OSMetaClass * gOSStringMetaClass; |
| 341 | extern OSMetaClass * gOSBooleanMetaClass; |
| 342 | extern OSMetaClass * gOSDictionaryMetaClass; |
| 343 | extern OSMetaClass * gOSArrayMetaClass; |
| 344 | extern OSMetaClass * gOSSetMetaClass; |
| 345 | extern OSMetaClass * gOSOrderedSetMetaClass; |
| 346 | extern OSMetaClass * gIODispatchQueueMetaClass; |
| 347 | extern OSMetaClass * gIOServiceMetaClass; |
| 348 | extern OSMetaClass * gIOMemoryMapMetaClass; |
| 349 | #endif /* !KERNEL */ |
| 350 | |
| 351 | #if !KERNEL |
| 352 | |
| 353 | #define IOExtensiblePaniclog_QueueNames "" |
| 354 | |
| 355 | #define IOExtensiblePaniclog_MethodNames "" |
| 356 | |
| 357 | #define IOExtensiblePaniclogMetaClass_MethodNames "" |
| 358 | |
| 359 | struct OSClassDescription_IOExtensiblePaniclog_t |
| 360 | { |
| 361 | OSClassDescription base; |
| 362 | uint64_t methodOptions[2 * 0]; |
| 363 | uint64_t metaMethodOptions[2 * 0]; |
| 364 | char queueNames[sizeof(IOExtensiblePaniclog_QueueNames)]; |
| 365 | char methodNames[sizeof(IOExtensiblePaniclog_MethodNames)]; |
| 366 | char metaMethodNames[sizeof(IOExtensiblePaniclogMetaClass_MethodNames)]; |
| 367 | }; |
| 368 | |
| 369 | const struct OSClassDescription_IOExtensiblePaniclog_t |
| 370 | OSClassDescription_IOExtensiblePaniclog = |
| 371 | { |
| 372 | .base = |
| 373 | { |
| 374 | .descriptionSize = sizeof(OSClassDescription_IOExtensiblePaniclog_t), |
| 375 | .name = "IOExtensiblePaniclog" , |
| 376 | .superName = "OSObject" , |
| 377 | .methodOptionsSize = 2 * sizeof(uint64_t) * 0, |
| 378 | .methodOptionsOffset = __builtin_offsetof(struct OSClassDescription_IOExtensiblePaniclog_t, methodOptions), |
| 379 | .metaMethodOptionsSize = 2 * sizeof(uint64_t) * 0, |
| 380 | .metaMethodOptionsOffset = __builtin_offsetof(struct OSClassDescription_IOExtensiblePaniclog_t, metaMethodOptions), |
| 381 | .queueNamesSize = sizeof(IOExtensiblePaniclog_QueueNames), |
| 382 | .queueNamesOffset = __builtin_offsetof(struct OSClassDescription_IOExtensiblePaniclog_t, queueNames), |
| 383 | .methodNamesSize = sizeof(IOExtensiblePaniclog_MethodNames), |
| 384 | .methodNamesOffset = __builtin_offsetof(struct OSClassDescription_IOExtensiblePaniclog_t, methodNames), |
| 385 | .metaMethodNamesSize = sizeof(IOExtensiblePaniclogMetaClass_MethodNames), |
| 386 | .metaMethodNamesOffset = __builtin_offsetof(struct OSClassDescription_IOExtensiblePaniclog_t, metaMethodNames), |
| 387 | .flags = 1*kOSClassCanRemote, |
| 388 | }, |
| 389 | .methodOptions = |
| 390 | { |
| 391 | }, |
| 392 | .metaMethodOptions = |
| 393 | { |
| 394 | }, |
| 395 | .queueNames = IOExtensiblePaniclog_QueueNames, |
| 396 | .methodNames = IOExtensiblePaniclog_MethodNames, |
| 397 | .metaMethodNames = IOExtensiblePaniclogMetaClass_MethodNames, |
| 398 | }; |
| 399 | |
| 400 | OSMetaClass * gIOExtensiblePaniclogMetaClass; |
| 401 | |
| 402 | static kern_return_t |
| 403 | IOExtensiblePaniclog_New(OSMetaClass * instance); |
| 404 | |
| 405 | const OSClassLoadInformation |
| 406 | IOExtensiblePaniclog_Class = |
| 407 | { |
| 408 | .description = &OSClassDescription_IOExtensiblePaniclog.base, |
| 409 | .metaPointer = &gIOExtensiblePaniclogMetaClass, |
| 410 | .version = 1, |
| 411 | .instanceSize = sizeof(IOExtensiblePaniclog), |
| 412 | |
| 413 | .New = &IOExtensiblePaniclog_New, |
| 414 | }; |
| 415 | |
| 416 | extern const void * const |
| 417 | gIOExtensiblePaniclog_Declaration; |
| 418 | const void * const |
| 419 | gIOExtensiblePaniclog_Declaration |
| 420 | __attribute__((visibility("hidden" ),section("__DATA_CONST,__osclassinfo,regular,no_dead_strip" ),no_sanitize("address" ))) |
| 421 | = &IOExtensiblePaniclog_Class; |
| 422 | |
| 423 | static kern_return_t |
| 424 | IOExtensiblePaniclog_New(OSMetaClass * instance) |
| 425 | { |
| 426 | if (!new(instance) IOExtensiblePaniclogMetaClass) return (kIOReturnNoMemory); |
| 427 | return (kIOReturnSuccess); |
| 428 | } |
| 429 | |
| 430 | kern_return_t |
| 431 | IOExtensiblePaniclogMetaClass::New(OSObject * instance) |
| 432 | { |
| 433 | if (!new(instance) IOExtensiblePaniclog) return (kIOReturnNoMemory); |
| 434 | return (kIOReturnSuccess); |
| 435 | } |
| 436 | |
| 437 | #endif /* !KERNEL */ |
| 438 | |
| 439 | kern_return_t |
| 440 | IOExtensiblePaniclog::Dispatch(const IORPC rpc) |
| 441 | { |
| 442 | return _Dispatch(self: this, rpc); |
| 443 | } |
| 444 | |
| 445 | kern_return_t |
| 446 | IOExtensiblePaniclog::_Dispatch(IOExtensiblePaniclog * self, const IORPC rpc) |
| 447 | { |
| 448 | kern_return_t ret = kIOReturnUnsupported; |
| 449 | IORPCMessage * msg = IORPCMessageFromMach(msg: rpc.message, reply: false); |
| 450 | |
| 451 | switch (msg->msgid) |
| 452 | { |
| 453 | #if KERNEL |
| 454 | case IOExtensiblePaniclog_SetActive_ID: |
| 455 | { |
| 456 | ret = IOExtensiblePaniclog::SetActive_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::SetActive_Handler, *self, &IOExtensiblePaniclog::SetActive_Impl)); |
| 457 | break; |
| 458 | } |
| 459 | #endif /* !KERNEL */ |
| 460 | #if KERNEL |
| 461 | case IOExtensiblePaniclog_SetInactive_ID: |
| 462 | { |
| 463 | ret = IOExtensiblePaniclog::SetInactive_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::SetInactive_Handler, *self, &IOExtensiblePaniclog::SetInactive_Impl)); |
| 464 | break; |
| 465 | } |
| 466 | #endif /* !KERNEL */ |
| 467 | #if KERNEL |
| 468 | case IOExtensiblePaniclog_InsertData_ID: |
| 469 | { |
| 470 | ret = IOExtensiblePaniclog::InsertData_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::InsertData_Handler, *self, &IOExtensiblePaniclog::InsertData_Impl)); |
| 471 | break; |
| 472 | } |
| 473 | #endif /* !KERNEL */ |
| 474 | #if KERNEL |
| 475 | case IOExtensiblePaniclog_AppendData_ID: |
| 476 | { |
| 477 | ret = IOExtensiblePaniclog::AppendData_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::AppendData_Handler, *self, &IOExtensiblePaniclog::AppendData_Impl)); |
| 478 | break; |
| 479 | } |
| 480 | #endif /* !KERNEL */ |
| 481 | #if KERNEL |
| 482 | case IOExtensiblePaniclog_CopyMemoryDescriptor_ID: |
| 483 | { |
| 484 | ret = IOExtensiblePaniclog::CopyMemoryDescriptor_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::CopyMemoryDescriptor_Handler, *self, &IOExtensiblePaniclog::CopyMemoryDescriptor_Impl)); |
| 485 | break; |
| 486 | } |
| 487 | #endif /* !KERNEL */ |
| 488 | #if KERNEL |
| 489 | case IOExtensiblePaniclog_SetUsedLen_ID: |
| 490 | { |
| 491 | ret = IOExtensiblePaniclog::SetUsedLen_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOExtensiblePaniclog::SetUsedLen_Handler, *self, &IOExtensiblePaniclog::SetUsedLen_Impl)); |
| 492 | break; |
| 493 | } |
| 494 | #endif /* !KERNEL */ |
| 495 | |
| 496 | default: |
| 497 | ret = OSObject::_Dispatch(self, rpc); |
| 498 | break; |
| 499 | } |
| 500 | |
| 501 | return (ret); |
| 502 | } |
| 503 | |
| 504 | #if KERNEL |
| 505 | kern_return_t |
| 506 | IOExtensiblePaniclog::MetaClass::Dispatch(const IORPC rpc) |
| 507 | { |
| 508 | #else /* KERNEL */ |
| 509 | kern_return_t |
| 510 | IOExtensiblePaniclogMetaClass::Dispatch(const IORPC rpc) |
| 511 | { |
| 512 | #endif /* !KERNEL */ |
| 513 | |
| 514 | kern_return_t ret = kIOReturnUnsupported; |
| 515 | IORPCMessage * msg = IORPCMessageFromMach(msg: rpc.message, reply: false); |
| 516 | |
| 517 | switch (msg->msgid) |
| 518 | { |
| 519 | #if KERNEL |
| 520 | case IOExtensiblePaniclog_Create_ID: |
| 521 | ret = IOExtensiblePaniclog::Create_Invoke(rpc, func: &IOExtensiblePaniclog::Create_Impl); |
| 522 | break; |
| 523 | #endif /* !KERNEL */ |
| 524 | |
| 525 | default: |
| 526 | ret = OSMetaClassBase::Dispatch(rpc); |
| 527 | break; |
| 528 | } |
| 529 | |
| 530 | return (ret); |
| 531 | } |
| 532 | |
| 533 | kern_return_t |
| 534 | IOExtensiblePaniclog::Create( |
| 535 | OSData * uuid, |
| 536 | OSString * data_id, |
| 537 | uint32_t max_len, |
| 538 | uint32_t options, |
| 539 | IOExtensiblePaniclog ** out) |
| 540 | { |
| 541 | kern_return_t ret; |
| 542 | union |
| 543 | { |
| 544 | IOExtensiblePaniclog_Create_Msg msg; |
| 545 | struct |
| 546 | { |
| 547 | IOExtensiblePaniclog_Create_Rpl rpl; |
| 548 | mach_msg_max_trailer_t trailer; |
| 549 | } rpl; |
| 550 | } buf; |
| 551 | struct IOExtensiblePaniclog_Create_Msg * msg = &buf.msg; |
| 552 | struct IOExtensiblePaniclog_Create_Rpl * rpl = &buf.rpl.rpl; |
| 553 | |
| 554 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_Create_Msg)); |
| 555 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 556 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 557 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 558 | | 0*kIORPCMessageSimpleReply |
| 559 | | 0*kIORPCMessageLocalHost |
| 560 | | 0*kIORPCMessageOnqueue; |
| 561 | msg->content.__hdr.msgid = IOExtensiblePaniclog_Create_ID; |
| 562 | msg->content.__object = (OSObjectRef) OSTypeID(IOExtensiblePaniclog); |
| 563 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_Create_Msg_ObjRefs; |
| 564 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
| 565 | |
| 566 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 567 | |
| 568 | msg->uuid__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
| 569 | msg->uuid__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
| 570 | msg->uuid__descriptor.address = (void *) __builtin_offsetof(IOExtensiblePaniclog_Create_Msg_Content, uuid); |
| 571 | msg->content.uuid = uuid; |
| 572 | |
| 573 | msg->data_id__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
| 574 | msg->data_id__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
| 575 | msg->data_id__descriptor.address = (void *) __builtin_offsetof(IOExtensiblePaniclog_Create_Msg_Content, data_id); |
| 576 | msg->content.data_id = data_id; |
| 577 | |
| 578 | msg->content.max_len = max_len; |
| 579 | |
| 580 | msg->content.options = options; |
| 581 | |
| 582 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 583 | ret = OSMTypeID(IOExtensiblePaniclog)->Invoke(rpc); |
| 584 | |
| 585 | if (kIOReturnSuccess == ret) |
| 586 | do { |
| 587 | { |
| 588 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 589 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_Create_ID) { ret = kIOReturnIPCError; break; }; |
| 590 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
| 591 | if (IOExtensiblePaniclog_Create_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 592 | } |
| 593 | } |
| 594 | while (false); |
| 595 | if (kIOReturnSuccess == ret) |
| 596 | { |
| 597 | *out = OSDynamicCast(IOExtensiblePaniclog, (OSObject *) rpl->content.out); |
| 598 | if (rpl->content.out && !*out) ret = kIOReturnBadArgument; |
| 599 | } |
| 600 | |
| 601 | |
| 602 | return (ret); |
| 603 | } |
| 604 | |
| 605 | kern_return_t |
| 606 | IOExtensiblePaniclog::SetActive( OSDispatchMethod supermethod) |
| 607 | { |
| 608 | kern_return_t ret; |
| 609 | union |
| 610 | { |
| 611 | IOExtensiblePaniclog_SetActive_Msg msg; |
| 612 | struct |
| 613 | { |
| 614 | IOExtensiblePaniclog_SetActive_Rpl rpl; |
| 615 | mach_msg_max_trailer_t trailer; |
| 616 | } rpl; |
| 617 | } buf; |
| 618 | struct IOExtensiblePaniclog_SetActive_Msg * msg = &buf.msg; |
| 619 | struct IOExtensiblePaniclog_SetActive_Rpl * rpl = &buf.rpl.rpl; |
| 620 | |
| 621 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_SetActive_Msg)); |
| 622 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 623 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 624 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 625 | | 1*kIORPCMessageSimpleReply |
| 626 | | 0*kIORPCMessageLocalHost |
| 627 | | 0*kIORPCMessageOnqueue; |
| 628 | msg->content.__hdr.msgid = IOExtensiblePaniclog_SetActive_ID; |
| 629 | msg->content.__object = (OSObjectRef) this; |
| 630 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_SetActive_Msg_ObjRefs; |
| 631 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
| 632 | |
| 633 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 634 | |
| 635 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 636 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 637 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 638 | |
| 639 | if (kIOReturnSuccess == ret) |
| 640 | do { |
| 641 | { |
| 642 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 643 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_SetActive_ID) { ret = kIOReturnIPCError; break; }; |
| 644 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
| 645 | if (IOExtensiblePaniclog_SetActive_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 646 | } |
| 647 | } |
| 648 | while (false); |
| 649 | if (kIOReturnSuccess == ret) |
| 650 | { |
| 651 | } |
| 652 | |
| 653 | |
| 654 | return (ret); |
| 655 | } |
| 656 | |
| 657 | kern_return_t |
| 658 | IOExtensiblePaniclog::SetInactive( OSDispatchMethod supermethod) |
| 659 | { |
| 660 | kern_return_t ret; |
| 661 | union |
| 662 | { |
| 663 | IOExtensiblePaniclog_SetInactive_Msg msg; |
| 664 | struct |
| 665 | { |
| 666 | IOExtensiblePaniclog_SetInactive_Rpl rpl; |
| 667 | mach_msg_max_trailer_t trailer; |
| 668 | } rpl; |
| 669 | } buf; |
| 670 | struct IOExtensiblePaniclog_SetInactive_Msg * msg = &buf.msg; |
| 671 | struct IOExtensiblePaniclog_SetInactive_Rpl * rpl = &buf.rpl.rpl; |
| 672 | |
| 673 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_SetInactive_Msg)); |
| 674 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 675 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 676 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 677 | | 1*kIORPCMessageSimpleReply |
| 678 | | 0*kIORPCMessageLocalHost |
| 679 | | 0*kIORPCMessageOnqueue; |
| 680 | msg->content.__hdr.msgid = IOExtensiblePaniclog_SetInactive_ID; |
| 681 | msg->content.__object = (OSObjectRef) this; |
| 682 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_SetInactive_Msg_ObjRefs; |
| 683 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
| 684 | |
| 685 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 686 | |
| 687 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 688 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 689 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 690 | |
| 691 | if (kIOReturnSuccess == ret) |
| 692 | do { |
| 693 | { |
| 694 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 695 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_SetInactive_ID) { ret = kIOReturnIPCError; break; }; |
| 696 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
| 697 | if (IOExtensiblePaniclog_SetInactive_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 698 | } |
| 699 | } |
| 700 | while (false); |
| 701 | if (kIOReturnSuccess == ret) |
| 702 | { |
| 703 | } |
| 704 | |
| 705 | |
| 706 | return (ret); |
| 707 | } |
| 708 | |
| 709 | kern_return_t |
| 710 | IOExtensiblePaniclog::InsertData( |
| 711 | OSData * data, |
| 712 | OSDispatchMethod supermethod) |
| 713 | { |
| 714 | kern_return_t ret; |
| 715 | union |
| 716 | { |
| 717 | IOExtensiblePaniclog_InsertData_Msg msg; |
| 718 | struct |
| 719 | { |
| 720 | IOExtensiblePaniclog_InsertData_Rpl rpl; |
| 721 | mach_msg_max_trailer_t trailer; |
| 722 | } rpl; |
| 723 | } buf; |
| 724 | struct IOExtensiblePaniclog_InsertData_Msg * msg = &buf.msg; |
| 725 | struct IOExtensiblePaniclog_InsertData_Rpl * rpl = &buf.rpl.rpl; |
| 726 | |
| 727 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_InsertData_Msg)); |
| 728 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 729 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 730 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 731 | | 0*kIORPCMessageSimpleReply |
| 732 | | 0*kIORPCMessageLocalHost |
| 733 | | 0*kIORPCMessageOnqueue; |
| 734 | msg->content.__hdr.msgid = IOExtensiblePaniclog_InsertData_ID; |
| 735 | msg->content.__object = (OSObjectRef) this; |
| 736 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_InsertData_Msg_ObjRefs; |
| 737 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
| 738 | |
| 739 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 740 | |
| 741 | msg->data__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
| 742 | msg->data__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
| 743 | msg->data__descriptor.address = (void *) __builtin_offsetof(IOExtensiblePaniclog_InsertData_Msg_Content, data); |
| 744 | msg->content.data = data; |
| 745 | |
| 746 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 747 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 748 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 749 | |
| 750 | if (kIOReturnSuccess == ret) |
| 751 | do { |
| 752 | { |
| 753 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 754 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_InsertData_ID) { ret = kIOReturnIPCError; break; }; |
| 755 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
| 756 | if (IOExtensiblePaniclog_InsertData_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 757 | } |
| 758 | } |
| 759 | while (false); |
| 760 | if (kIOReturnSuccess == ret) |
| 761 | { |
| 762 | } |
| 763 | |
| 764 | |
| 765 | return (ret); |
| 766 | } |
| 767 | |
| 768 | kern_return_t |
| 769 | IOExtensiblePaniclog::AppendData( |
| 770 | OSData * data, |
| 771 | OSDispatchMethod supermethod) |
| 772 | { |
| 773 | kern_return_t ret; |
| 774 | union |
| 775 | { |
| 776 | IOExtensiblePaniclog_AppendData_Msg msg; |
| 777 | struct |
| 778 | { |
| 779 | IOExtensiblePaniclog_AppendData_Rpl rpl; |
| 780 | mach_msg_max_trailer_t trailer; |
| 781 | } rpl; |
| 782 | } buf; |
| 783 | struct IOExtensiblePaniclog_AppendData_Msg * msg = &buf.msg; |
| 784 | struct IOExtensiblePaniclog_AppendData_Rpl * rpl = &buf.rpl.rpl; |
| 785 | |
| 786 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_AppendData_Msg)); |
| 787 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 788 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 789 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 790 | | 0*kIORPCMessageSimpleReply |
| 791 | | 0*kIORPCMessageLocalHost |
| 792 | | 0*kIORPCMessageOnqueue; |
| 793 | msg->content.__hdr.msgid = IOExtensiblePaniclog_AppendData_ID; |
| 794 | msg->content.__object = (OSObjectRef) this; |
| 795 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_AppendData_Msg_ObjRefs; |
| 796 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
| 797 | |
| 798 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 799 | |
| 800 | msg->data__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
| 801 | msg->data__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
| 802 | msg->data__descriptor.address = (void *) __builtin_offsetof(IOExtensiblePaniclog_AppendData_Msg_Content, data); |
| 803 | msg->content.data = data; |
| 804 | |
| 805 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 806 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 807 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 808 | |
| 809 | if (kIOReturnSuccess == ret) |
| 810 | do { |
| 811 | { |
| 812 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 813 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_AppendData_ID) { ret = kIOReturnIPCError; break; }; |
| 814 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
| 815 | if (IOExtensiblePaniclog_AppendData_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 816 | } |
| 817 | } |
| 818 | while (false); |
| 819 | if (kIOReturnSuccess == ret) |
| 820 | { |
| 821 | } |
| 822 | |
| 823 | |
| 824 | return (ret); |
| 825 | } |
| 826 | |
| 827 | kern_return_t |
| 828 | IOExtensiblePaniclog::CopyMemoryDescriptor( |
| 829 | IOBufferMemoryDescriptor ** mem, |
| 830 | OSDispatchMethod supermethod) |
| 831 | { |
| 832 | kern_return_t ret; |
| 833 | union |
| 834 | { |
| 835 | IOExtensiblePaniclog_CopyMemoryDescriptor_Msg msg; |
| 836 | struct |
| 837 | { |
| 838 | IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl rpl; |
| 839 | mach_msg_max_trailer_t trailer; |
| 840 | } rpl; |
| 841 | } buf; |
| 842 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Msg * msg = &buf.msg; |
| 843 | struct IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl * rpl = &buf.rpl.rpl; |
| 844 | |
| 845 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_CopyMemoryDescriptor_Msg)); |
| 846 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 847 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 848 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 849 | | 0*kIORPCMessageSimpleReply |
| 850 | | 0*kIORPCMessageLocalHost |
| 851 | | 0*kIORPCMessageOnqueue; |
| 852 | msg->content.__hdr.msgid = IOExtensiblePaniclog_CopyMemoryDescriptor_ID; |
| 853 | msg->content.__object = (OSObjectRef) this; |
| 854 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_CopyMemoryDescriptor_Msg_ObjRefs; |
| 855 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
| 856 | |
| 857 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 858 | |
| 859 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 860 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 861 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 862 | |
| 863 | if (kIOReturnSuccess == ret) |
| 864 | do { |
| 865 | { |
| 866 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 867 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_CopyMemoryDescriptor_ID) { ret = kIOReturnIPCError; break; }; |
| 868 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
| 869 | if (IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 870 | } |
| 871 | } |
| 872 | while (false); |
| 873 | if (kIOReturnSuccess == ret) |
| 874 | { |
| 875 | *mem = OSDynamicCast(IOBufferMemoryDescriptor, (OSObject *) rpl->content.mem); |
| 876 | if (rpl->content.mem && !*mem) ret = kIOReturnBadArgument; |
| 877 | } |
| 878 | |
| 879 | |
| 880 | return (ret); |
| 881 | } |
| 882 | |
| 883 | kern_return_t |
| 884 | IOExtensiblePaniclog::SetUsedLen( |
| 885 | uint32_t used_len, |
| 886 | OSDispatchMethod supermethod) |
| 887 | { |
| 888 | kern_return_t ret; |
| 889 | union |
| 890 | { |
| 891 | IOExtensiblePaniclog_SetUsedLen_Msg msg; |
| 892 | struct |
| 893 | { |
| 894 | IOExtensiblePaniclog_SetUsedLen_Rpl rpl; |
| 895 | mach_msg_max_trailer_t trailer; |
| 896 | } rpl; |
| 897 | } buf; |
| 898 | struct IOExtensiblePaniclog_SetUsedLen_Msg * msg = &buf.msg; |
| 899 | struct IOExtensiblePaniclog_SetUsedLen_Rpl * rpl = &buf.rpl.rpl; |
| 900 | |
| 901 | memset(s: msg, c: 0, n: sizeof(struct IOExtensiblePaniclog_SetUsedLen_Msg)); |
| 902 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
| 903 | msg->mach.msgh.msgh_size = sizeof(*msg); |
| 904 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
| 905 | | 1*kIORPCMessageSimpleReply |
| 906 | | 0*kIORPCMessageLocalHost |
| 907 | | 0*kIORPCMessageOnqueue; |
| 908 | msg->content.__hdr.msgid = IOExtensiblePaniclog_SetUsedLen_ID; |
| 909 | msg->content.__object = (OSObjectRef) this; |
| 910 | msg->content.__hdr.objectRefs = IOExtensiblePaniclog_SetUsedLen_Msg_ObjRefs; |
| 911 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
| 912 | |
| 913 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 914 | |
| 915 | msg->content.used_len = used_len; |
| 916 | |
| 917 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
| 918 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
| 919 | else ret = ((OSObject *)this)->Invoke(rpc); |
| 920 | |
| 921 | if (kIOReturnSuccess == ret) |
| 922 | do { |
| 923 | { |
| 924 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
| 925 | if (rpl->content.__hdr.msgid != IOExtensiblePaniclog_SetUsedLen_ID) { ret = kIOReturnIPCError; break; }; |
| 926 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
| 927 | if (IOExtensiblePaniclog_SetUsedLen_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
| 928 | } |
| 929 | } |
| 930 | while (false); |
| 931 | if (kIOReturnSuccess == ret) |
| 932 | { |
| 933 | } |
| 934 | |
| 935 | |
| 936 | return (ret); |
| 937 | } |
| 938 | |
| 939 | kern_return_t |
| 940 | IOExtensiblePaniclog::Create_Invoke(const IORPC _rpc, |
| 941 | Create_Handler func) |
| 942 | { |
| 943 | IOExtensiblePaniclog_Create_Invocation rpc = { .rpc: _rpc }; |
| 944 | kern_return_t ret; |
| 945 | |
| 946 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 947 | if (IOExtensiblePaniclog_Create_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 948 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_Create_Msg)) return (kIOReturnIPCError); |
| 949 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_Create_Rpl)) return (kIOReturnIPCError); |
| 950 | if (((OSObject *) rpc.message->content.uuid) != NULL && OSDynamicCast(OSData, (OSObject *) rpc.message->content.uuid) == NULL) { return kIOReturnBadArgument; } |
| 951 | if (((OSObject *) rpc.message->content.data_id) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.data_id) == NULL) { return kIOReturnBadArgument; } |
| 952 | |
| 953 | ret = (*func)( rpc.message->content.uuid, |
| 954 | rpc.message->content.data_id, |
| 955 | rpc.message->content.max_len, |
| 956 | rpc.message->content.options, |
| 957 | (IOExtensiblePaniclog **)&rpc.reply->content.out); |
| 958 | |
| 959 | if (kIOReturnSuccess != ret) return (ret); |
| 960 | |
| 961 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_Create_ID; |
| 962 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 963 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 964 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 965 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
| 966 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_Create_Rpl_ObjRefs; |
| 967 | rpc.reply->out__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 968 | |
| 969 | return (ret); |
| 970 | } |
| 971 | |
| 972 | kern_return_t |
| 973 | IOExtensiblePaniclog::SetActive_Invoke(const IORPC _rpc, |
| 974 | OSMetaClassBase * target, |
| 975 | SetActive_Handler func) |
| 976 | { |
| 977 | IOExtensiblePaniclog_SetActive_Invocation rpc = { .rpc: _rpc }; |
| 978 | kern_return_t ret; |
| 979 | |
| 980 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 981 | if (IOExtensiblePaniclog_SetActive_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 982 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_SetActive_Msg)) return (kIOReturnIPCError); |
| 983 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_SetActive_Rpl)) return (kIOReturnIPCError); |
| 984 | |
| 985 | ret = (*func)(target); |
| 986 | |
| 987 | if (kIOReturnSuccess != ret) return (ret); |
| 988 | |
| 989 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_SetActive_ID; |
| 990 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 991 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 992 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 993 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
| 994 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_SetActive_Rpl_ObjRefs; |
| 995 | |
| 996 | return (ret); |
| 997 | } |
| 998 | |
| 999 | kern_return_t |
| 1000 | IOExtensiblePaniclog::SetInactive_Invoke(const IORPC _rpc, |
| 1001 | OSMetaClassBase * target, |
| 1002 | SetInactive_Handler func) |
| 1003 | { |
| 1004 | IOExtensiblePaniclog_SetInactive_Invocation rpc = { .rpc: _rpc }; |
| 1005 | kern_return_t ret; |
| 1006 | |
| 1007 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 1008 | if (IOExtensiblePaniclog_SetInactive_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 1009 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_SetInactive_Msg)) return (kIOReturnIPCError); |
| 1010 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_SetInactive_Rpl)) return (kIOReturnIPCError); |
| 1011 | |
| 1012 | ret = (*func)(target); |
| 1013 | |
| 1014 | if (kIOReturnSuccess != ret) return (ret); |
| 1015 | |
| 1016 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_SetInactive_ID; |
| 1017 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 1018 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 1019 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 1020 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
| 1021 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_SetInactive_Rpl_ObjRefs; |
| 1022 | |
| 1023 | return (ret); |
| 1024 | } |
| 1025 | |
| 1026 | kern_return_t |
| 1027 | IOExtensiblePaniclog::InsertData_Invoke(const IORPC _rpc, |
| 1028 | OSMetaClassBase * target, |
| 1029 | InsertData_Handler func) |
| 1030 | { |
| 1031 | IOExtensiblePaniclog_InsertData_Invocation rpc = { .rpc: _rpc }; |
| 1032 | kern_return_t ret; |
| 1033 | |
| 1034 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 1035 | if (IOExtensiblePaniclog_InsertData_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 1036 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_InsertData_Msg)) return (kIOReturnIPCError); |
| 1037 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_InsertData_Rpl)) return (kIOReturnIPCError); |
| 1038 | if (((OSObject *) rpc.message->content.data) != NULL && OSDynamicCast(OSData, (OSObject *) rpc.message->content.data) == NULL) { return kIOReturnBadArgument; } |
| 1039 | |
| 1040 | ret = (*func)(target, |
| 1041 | rpc.message->content.data); |
| 1042 | |
| 1043 | if (kIOReturnSuccess != ret) return (ret); |
| 1044 | |
| 1045 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_InsertData_ID; |
| 1046 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 1047 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 1048 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 1049 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
| 1050 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_InsertData_Rpl_ObjRefs; |
| 1051 | |
| 1052 | return (ret); |
| 1053 | } |
| 1054 | |
| 1055 | kern_return_t |
| 1056 | IOExtensiblePaniclog::AppendData_Invoke(const IORPC _rpc, |
| 1057 | OSMetaClassBase * target, |
| 1058 | AppendData_Handler func) |
| 1059 | { |
| 1060 | IOExtensiblePaniclog_AppendData_Invocation rpc = { .rpc: _rpc }; |
| 1061 | kern_return_t ret; |
| 1062 | |
| 1063 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 1064 | if (IOExtensiblePaniclog_AppendData_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 1065 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_AppendData_Msg)) return (kIOReturnIPCError); |
| 1066 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_AppendData_Rpl)) return (kIOReturnIPCError); |
| 1067 | if (((OSObject *) rpc.message->content.data) != NULL && OSDynamicCast(OSData, (OSObject *) rpc.message->content.data) == NULL) { return kIOReturnBadArgument; } |
| 1068 | |
| 1069 | ret = (*func)(target, |
| 1070 | rpc.message->content.data); |
| 1071 | |
| 1072 | if (kIOReturnSuccess != ret) return (ret); |
| 1073 | |
| 1074 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_AppendData_ID; |
| 1075 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 1076 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 1077 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 1078 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
| 1079 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_AppendData_Rpl_ObjRefs; |
| 1080 | |
| 1081 | return (ret); |
| 1082 | } |
| 1083 | |
| 1084 | kern_return_t |
| 1085 | IOExtensiblePaniclog::CopyMemoryDescriptor_Invoke(const IORPC _rpc, |
| 1086 | OSMetaClassBase * target, |
| 1087 | CopyMemoryDescriptor_Handler func) |
| 1088 | { |
| 1089 | IOExtensiblePaniclog_CopyMemoryDescriptor_Invocation rpc = { .rpc: _rpc }; |
| 1090 | kern_return_t ret; |
| 1091 | |
| 1092 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 1093 | if (IOExtensiblePaniclog_CopyMemoryDescriptor_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 1094 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_CopyMemoryDescriptor_Msg)) return (kIOReturnIPCError); |
| 1095 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl)) return (kIOReturnIPCError); |
| 1096 | |
| 1097 | ret = (*func)(target, |
| 1098 | (IOBufferMemoryDescriptor **)&rpc.reply->content.mem); |
| 1099 | |
| 1100 | if (kIOReturnSuccess != ret) return (ret); |
| 1101 | |
| 1102 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_CopyMemoryDescriptor_ID; |
| 1103 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 1104 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 1105 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 1106 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
| 1107 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_CopyMemoryDescriptor_Rpl_ObjRefs; |
| 1108 | rpc.reply->mem__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
| 1109 | |
| 1110 | return (ret); |
| 1111 | } |
| 1112 | |
| 1113 | kern_return_t |
| 1114 | IOExtensiblePaniclog::SetUsedLen_Invoke(const IORPC _rpc, |
| 1115 | OSMetaClassBase * target, |
| 1116 | SetUsedLen_Handler func) |
| 1117 | { |
| 1118 | IOExtensiblePaniclog_SetUsedLen_Invocation rpc = { .rpc: _rpc }; |
| 1119 | kern_return_t ret; |
| 1120 | |
| 1121 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
| 1122 | if (IOExtensiblePaniclog_SetUsedLen_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
| 1123 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOExtensiblePaniclog_SetUsedLen_Msg)) return (kIOReturnIPCError); |
| 1124 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOExtensiblePaniclog_SetUsedLen_Rpl)) return (kIOReturnIPCError); |
| 1125 | |
| 1126 | ret = (*func)(target, |
| 1127 | rpc.message->content.used_len); |
| 1128 | |
| 1129 | if (kIOReturnSuccess != ret) return (ret); |
| 1130 | |
| 1131 | rpc.reply->content.__hdr.msgid = IOExtensiblePaniclog_SetUsedLen_ID; |
| 1132 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
| 1133 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
| 1134 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
| 1135 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
| 1136 | rpc.reply->content.__hdr.objectRefs = IOExtensiblePaniclog_SetUsedLen_Rpl_ObjRefs; |
| 1137 | |
| 1138 | return (ret); |
| 1139 | } |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | |