1*043036a2SApple OSS Distributions /* 2*043036a2SApple OSS Distributions * Copyright (c) 2022 Apple Computer, Inc. All rights reserved. 3*043036a2SApple OSS Distributions * 4*043036a2SApple OSS Distributions * @APPLE_LICENSE_HEADER_START@ 5*043036a2SApple OSS Distributions * 6*043036a2SApple OSS Distributions * The contents of this file constitute Original Code as defined in and 7*043036a2SApple OSS Distributions * are subject to the Apple Public Source License Version 1.1 (the 8*043036a2SApple OSS Distributions * "License"). You may not use this file except in compliance with the 9*043036a2SApple OSS Distributions * License. Please obtain a copy of the License at 10*043036a2SApple OSS Distributions * http://www.apple.com/publicsource and read it before using this file. 11*043036a2SApple OSS Distributions * 12*043036a2SApple OSS Distributions * This Original Code and all software distributed under the License are 13*043036a2SApple OSS Distributions * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14*043036a2SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15*043036a2SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16*043036a2SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17*043036a2SApple OSS Distributions * License for the specific language governing rights and limitations 18*043036a2SApple OSS Distributions * under the License. 19*043036a2SApple OSS Distributions * 20*043036a2SApple OSS Distributions * @APPLE_LICENSE_HEADER_END@ 21*043036a2SApple OSS Distributions */ 22*043036a2SApple OSS Distributions 23*043036a2SApple OSS Distributions #ifndef _KERN_LOCKDOWN_MODE_H_ 24*043036a2SApple OSS Distributions #define _KERN_LOCKDOWN_MODE_H_ 25*043036a2SApple OSS Distributions 26*043036a2SApple OSS Distributions #include <sys/cdefs.h> 27*043036a2SApple OSS Distributions __BEGIN_DECLS 28*043036a2SApple OSS Distributions 29*043036a2SApple OSS Distributions #if KERNEL_PRIVATE 30*043036a2SApple OSS Distributions /* XNU and Kernel extensions */ 31*043036a2SApple OSS Distributions 32*043036a2SApple OSS Distributions #if XNU_KERNEL_PRIVATE 33*043036a2SApple OSS Distributions 34*043036a2SApple OSS Distributions // Whether Lockdown Mode is enabled via the "ldm" nvram variable 35*043036a2SApple OSS Distributions extern int lockdown_mode_state; 36*043036a2SApple OSS Distributions 37*043036a2SApple OSS Distributions /** 38*043036a2SApple OSS Distributions * Initalizes Lockdown Mode 39*043036a2SApple OSS Distributions */ 40*043036a2SApple OSS Distributions void lockdown_mode_init(void); 41*043036a2SApple OSS Distributions 42*043036a2SApple OSS Distributions #endif /* XNU_KERNEL_PRIVATE */ 43*043036a2SApple OSS Distributions 44*043036a2SApple OSS Distributions /** 45*043036a2SApple OSS Distributions * Returns the Lockdown Mode enablement state 46*043036a2SApple OSS Distributions */ 47*043036a2SApple OSS Distributions int get_lockdown_mode_state(void); 48*043036a2SApple OSS Distributions 49*043036a2SApple OSS Distributions /** 50*043036a2SApple OSS Distributions * Enable Lockdown Mode by setting the nvram variable 51*043036a2SApple OSS Distributions */ 52*043036a2SApple OSS Distributions void enable_lockdown_mode(void); 53*043036a2SApple OSS Distributions 54*043036a2SApple OSS Distributions /** 55*043036a2SApple OSS Distributions * Disable Lockdown Mode by setting the nvram variable 56*043036a2SApple OSS Distributions */ 57*043036a2SApple OSS Distributions void disable_lockdown_mode(void); 58*043036a2SApple OSS Distributions 59*043036a2SApple OSS Distributions #endif /* KERNEL_PRIVATE */ 60*043036a2SApple OSS Distributions __END_DECLS 61*043036a2SApple OSS Distributions 62*043036a2SApple OSS Distributions #endif /* _KERN_LOCKDOWN_MODE_H_ */ 63