Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
OSLink.h
Go to the documentation of this file.
1#ifndef OSLINK_H
2#define OSLINK_H
3
4#include "dolphin/types.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define OS_MODULE_VERSION 3
11
13
20typedef struct OSRel OSRel;
21
26
28void* __OSStringTable AT_ADDRESS(0x800030D0);
29
34
39
41 OSModuleID id; // unique identifier for the module
42 OSModuleLink link; // doubly linked list of modules
43 u32 numSections; // # of sections
44 u32 sectionInfoOffset; // offset to section info table
45 u32 nameOffset; // offset to module name
46 u32 nameSize; // size of module name
47 u32 version; // version number
48};
49
51 // CAUTION: info must be the 1st member
53
54 // OS_MODULE_VERSION == 1
55 u32 bssSize; // total size of bss sections in bytes
58 u32 impSize; // size in bytes
59 u8 prologSection; // section # for prolog function
60 u8 epilogSection; // section # for epilog function
61 u8 unresolvedSection; // section # for unresolved function
62 u8 bssSection; // section # for bss section (set at run-time)
63 u32 prolog; // prolog function offset
64 u32 epilog; // epilog function offset
65 u32 unresolved; // unresolved function offset
66
67 // OS_MODULE_VERSION == 2
68#if (2 <= OS_MODULE_VERSION)
69 u32 align; // module alignment constraint
70 u32 bssAlign; // bss alignment constraint
71#endif
72
73 // OS_MODULE_VERSION == 3
74#if (3 <= OS_MODULE_VERSION)
76#endif
77};
78
79#define OSGetSectionInfo(module) ((OSSectionInfo*)(((OSModuleInfo*)(module))->sectionInfoOffset))
80
81#define OS_SECTIONINFO_EXEC 0x1
82#define OS_SECTIONINFO_OFFSET(offset) ((offset) & ~0x1)
83
85 OSModuleID id; // external module id
86 u32 offset; // offset to OSRel instructions
87};
88
89struct OSRel {
90 u16 offset; // byte offset from the previous entry
94};
95
96#define R_DOLPHIN_NOP 201 // C9h current offset += OSRel.offset
97#define R_DOLPHIN_SECTION 202 // CAh current section = OSRel.section
98#define R_DOLPHIN_END 203 // CBh
99#define R_DOLPHIN_MRKREF 204 // CCh
100
105void __OSModuleInit(void);
106
107#ifdef __cplusplus
108};
109#endif
110
111#endif /* OSLINK_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition OSLink.h:84
OSModuleID id
Definition OSLink.h:85
u32 offset
Definition OSLink.h:86
Definition OSLink.h:50
OSModuleInfo info
Definition OSLink.h:52
u8 prologSection
Definition OSLink.h:59
u32 epilog
Definition OSLink.h:64
u32 fixSize
Definition OSLink.h:75
u32 bssAlign
Definition OSLink.h:70
u32 align
Definition OSLink.h:69
u32 relOffset
Definition OSLink.h:56
u8 epilogSection
Definition OSLink.h:60
u32 impOffset
Definition OSLink.h:57
u32 impSize
Definition OSLink.h:58
u32 unresolved
Definition OSLink.h:65
u8 unresolvedSection
Definition OSLink.h:61
u32 bssSize
Definition OSLink.h:55
u8 bssSection
Definition OSLink.h:62
u32 prolog
Definition OSLink.h:63
Definition OSLink.h:40
u32 version
Definition OSLink.h:47
u32 numSections
Definition OSLink.h:43
OSModuleLink link
Definition OSLink.h:42
u32 sectionInfoOffset
Definition OSLink.h:44
OSModuleID id
Definition OSLink.h:41
u32 nameSize
Definition OSLink.h:46
u32 nameOffset
Definition OSLink.h:45
Definition OSLink.h:22
OSModuleInfo * tail
Definition OSLink.h:24
OSModuleInfo * head
Definition OSLink.h:23
Definition OSLink.h:89
u8 section
Definition OSLink.h:92
u32 addend
Definition OSLink.h:93
u16 offset
Definition OSLink.h:90
u8 type
Definition OSLink.h:91
Definition OSLink.h:35
u32 size
Definition OSLink.h:37
u32 offset
Definition OSLink.h:36
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8