]> git.saurik.com Git - apple/xnu.git/blob
96e21dc20e6dde28e772572766467472072ad26b
[apple/xnu.git] /
1 //
2 // test_intentionally_crashing_driver_56101852.cpp
3 // test_intentionally_crashing_driver_56101852
4 //
5 // Copyright © 2019 Apple Inc. All rights reserved.
6 //
7
8 #include <os/log.h>
9
10 #include <DriverKit/IOUserServer.h>
11 #include <DriverKit/IOLib.h>
12
13 #include "test_intentionally_crashing_driver_56101852.h"
14
15 kern_return_t
16 IMPL(test_intentionally_crashing_driver_56101852, Start)
17 {
18 kern_return_t ret;
19 ret = Start(provider, SUPERDISPATCH);
20 os_log(OS_LOG_DEFAULT, "Hello World");
21 return ret;
22 }
23
24 /* Intentionally crash */
25 __attribute__((constructor)) void
26 crash()
27 {
28 /* cause SIGILL */
29 __builtin_trap();
30 }