Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
ldt_keeper.c File Reference
#include "ldt_keeper.h"
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include "mmap_anon.h"

Classes

struct  user_desc
 

Macros

#define LDT_ENTRIES   8192
 
#define LDT_ENTRY_SIZE   8
 
#define MODIFY_LDT_CONTENTS_DATA   0
 
#define MODIFY_LDT_CONTENTS_STACK   1
 
#define MODIFY_LDT_CONTENTS_CODE   2
 
#define LDT_SEL(idx)   ((idx) << 3 | 1 << 2 | 3)
 
#define TEB_SEL_IDX   17
 

Functions

void Setup_FS_Segment (void)
 
ldt_fs_tSetup_LDT_Keeper (void)
 
void Restore_LDT_Keeper (ldt_fs_t *ldt_fs)
 

Variables

voidfs_seg =0
 

Macro Definition Documentation

◆ LDT_ENTRIES

#define LDT_ENTRIES   8192

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! This file MUST be in main library because LDT must be modified before program creates first thread

  • avifile includes this file from C++ code and initializes it at the start of player! it might sound like a hack and it really is - but as aviplay is decoding video with more than just one thread currently it's necessary to do it this way this might change in the future

◆ LDT_ENTRY_SIZE

#define LDT_ENTRY_SIZE   8

◆ LDT_SEL

#define LDT_SEL (   idx)    ((idx) << 3 | 1 << 2 | 3)

◆ MODIFY_LDT_CONTENTS_CODE

#define MODIFY_LDT_CONTENTS_CODE   2

◆ MODIFY_LDT_CONTENTS_DATA

#define MODIFY_LDT_CONTENTS_DATA   0

◆ MODIFY_LDT_CONTENTS_STACK

#define MODIFY_LDT_CONTENTS_STACK   1

◆ TEB_SEL_IDX

#define TEB_SEL_IDX   17

Function Documentation

◆ Restore_LDT_Keeper()

void Restore_LDT_Keeper ( ldt_fs_t ldt_fs)

◆ Setup_FS_Segment()

void Setup_FS_Segment ( void  )

here is a small logical problem with Restore for multithreaded programs - in C++ we use static class for this...

◆ Setup_LDT_Keeper()

ldt_fs_t * Setup_LDT_Keeper ( void  )

Variable Documentation

◆ fs_seg

void* fs_seg =0