OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Sip.c File Reference
#include <Uefi.h>
#include <IndustryStandard/AppleCsrConfig.h>
#include <Guid/AppleVariable.h>
#include <Library/OcVariableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>

Go to the source code of this file.

Functions

EFI_STATUS OcGetSip (OUT UINT32 *CsrActiveConfig, OUT UINT32 *Attributes OPTIONAL)
 
EFI_STATUS OcSetSip (IN UINT32 *CsrActiveConfig, IN UINT32 Attributes)
 
BOOLEAN OcIsSipEnabled (IN EFI_STATUS GetStatus, IN UINT32 CsrActiveConfig)
 
EFI_STATUS OcToggleSip (IN UINT32 CsrActiveConfig)
 

Detailed Description

Manage Apple SIP variable csr-active-config.

Copyright (C) 2021-2022, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Definition in file Sip.c.

Function Documentation

◆ OcGetSip()

EFI_STATUS OcGetSip ( OUT UINT32 * CsrActiveConfig,
OUT UINT32 *Attributes OPTIONAL )

Get current SIP setting.

Parameters
[out]CsrActiveConfigReturned csr-active-config variable; uninitialised if variable not found, or other error.
[out]AttributesIf not NULL, a pointer to the memory location to return the attributes bitmask for the variable; uninitialised if variable not found, or other error.
Return values
EFI_SUCCESS,EFI_NOT_FOUND,orother error returned by called code.

Definition at line 15 of file Sip.c.

◆ OcIsSipEnabled()

BOOLEAN OcIsSipEnabled ( IN EFI_STATUS GetStatus,
IN UINT32 CsrActiveConfig )

Is SIP enabled?

Parameters
[in]GetStatusReturn status from previous OcGetSip or gRT->GetVariable call.
[in]CsrActiveConfigcsr-active-config value from previous OcGetSip or gRT->GetVariable call. This value is never used unless GetStatus is EFI_SUCCESS.
Return values
TRUEif SIP should be considered enabled based on the passed values.

Definition at line 58 of file Sip.c.

◆ OcSetSip()

EFI_STATUS OcSetSip ( IN UINT32 * CsrActiveConfig,
IN UINT32 Attributes )

Set current SIP setting.

Parameters
[in]CsrActiveConfigcsr-active-config value to set, or NULL to clear the variable.
[in]AttributesAttributes to apply.
Return values
EFI_SUCCESS,EFI_NOT_FOUND,orother error returned by called code.

Definition at line 39 of file Sip.c.

◆ OcToggleSip()

EFI_STATUS OcToggleSip ( IN UINT32 CsrActiveConfig)

Toggle SIP.

Parameters
[in]CsrActiveConfigThe csr-active-config value to use to disable SIP, if it was previously enabled.
Return values
TRUEon successful operation.

Definition at line 73 of file Sip.c.