libnx  v4.2.0
Data Structures | Enumerations | Functions
jit.h File Reference

Just-in-time compilation support. More...

#include "../types.h"
#include "virtmem.h"

Go to the source code of this file.

Data Structures

struct  Jit
 JIT buffer object. More...
 

Enumerations

enum  JitType {
  JitType_SetProcessMemoryPermission,
  JitType_CodeMemory
}
 JIT implementation type. More...
 

Functions

Result jitCreate (Jit *j, size_t size)
 Creates a JIT buffer. More...
 
Result jitTransitionToWritable (Jit *j)
 Transition a JIT buffer to have writable permission. More...
 
Result jitTransitionToExecutable (Jit *j)
 Transition a JIT buffer to have executable permission. More...
 
Result jitClose (Jit *j)
 Destroys a JIT buffer. More...
 
static void * jitGetRwAddr (Jit *j)
 Gets the address of the writable memory alias of a JIT buffer. More...
 
static void * jitGetRxAddr (Jit *j)
 Gets the address of the executable memory alias of a JIT buffer. More...
 

Detailed Description

Just-in-time compilation support.

Author
plutoo

Enumeration Type Documentation

◆ JitType

enum JitType

JIT implementation type.

Enumerator
JitType_SetProcessMemoryPermission 

JIT supported using svcSetProcessMemoryPermission.

JitType_CodeMemory 

JIT supported using [4.0.0+] CodeMemory syscalls.

Function Documentation

◆ jitClose()

Result jitClose ( Jit j)

Destroys a JIT buffer.

Parameters
jJIT buffer.
Returns
Result code.

◆ jitCreate()

Result jitCreate ( Jit j,
size_t  size 
)

Creates a JIT buffer.

Parameters
jJIT buffer.
sizeSize of the JIT buffer.
Returns
Result code.

◆ jitGetRwAddr()

static void* jitGetRwAddr ( Jit j)
inlinestatic

Gets the address of the writable memory alias of a JIT buffer.

Parameters
jJIT buffer.
Returns
Pointer to alias of the JIT buffer that can be written to.

◆ jitGetRxAddr()

static void* jitGetRxAddr ( Jit j)
inlinestatic

Gets the address of the executable memory alias of a JIT buffer.

Parameters
jJIT buffer.
Returns
Pointer to alias of the JIT buffer that can be executed.

◆ jitTransitionToExecutable()

Result jitTransitionToExecutable ( Jit j)

Transition a JIT buffer to have executable permission.

Parameters
jJIT buffer.
Returns
Result code.

◆ jitTransitionToWritable()

Result jitTransitionToWritable ( Jit j)

Transition a JIT buffer to have writable permission.

Parameters
jJIT buffer.
Returns
Result code.