kmod: prepare for kernel module loading
This commit is contained in:
parent
30017592ad
commit
d017412af5
3 changed files with 31 additions and 4 deletions
22
kernel/src/dbg/export.h
Normal file
22
kernel/src/dbg/export.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// At Soaplin, we aren't doing module racism based on the license. (Ḭ̸̡̢̨̧̨̛͍͚̙̺̦̩͕̮̙̙̳̮͉̝̙̜͓̪͇̠̪̣̻̰͕̲̲̘̖̦͖͕͎̲̹͖̮̳̻̞̌͋̋̆͛̉͆ ̸̨͕͎̣̥͖͔̳̫̳͚̯̬̙̘͓̹̼̻̼̈̓̉ͅͅs̶̟͉̠̣̞͎͍̘̟̝̱̩̃͛̽͛̆͌̆̒̔̈́̎̿̐̈́͐̓̓͒͌̈̀̓͗̋̕͜͜͝͠͝͠ͅȩ̸̡̛͔̦̲̦̼̹̙̲͖͎̼̝̯̦̞̜͍̀̈́̈́͂̈́̍́̆̆̔͗́̆̀͑̀̔͆̄͐͐̆͠ę̸̨̢̢̧̛̛͕̱̯̲̦͕͖̦̝̯̮̤̫͙͔̲̬̯̗̗͈̬̳̙͙̼͉̩͚̼̮͚̖̰̗̤͓̘͂̾̒͋̀͂̏́̂̋̅̆̋̈̔̈́̀̔̈́̊̓͂͌̋̂́̍̀͒͊͊̓͌̃̚͘͜͝͠ ̸̧̡̧͍̼̹͇̞̘͇̯̞̣̝̲̳̦̟̱͇̥͈̟̝̹̳̫͕̜̬̥̯̬̟̤̖̹̙̩̰̈͗͆͌̊̽̾͝͝ͅy̵̡̡̢̞̭͔̰͔͔̖̥͕̙̳̯͍͉̦̦͓̥̞̝͖͕̰̼͖̲̮͚̲̜̰̱̘̯̤̌́̏̄̏́̈́̓ͅỡ̵̢̢̢̖̠͉̖̺̻̣̜̬̮͓̫͎͖͎̤̪̝̗̰͕͍͖̖̟͙͍̻̑͊̃̃̒̍̆̎̋̿͐̋̉̇̾͆̿̌̃̏̽̊̀͒̇̏̓̾̏̈́̓̿̏̚͠͝͝͝ͅu̸̧͕̟͉͉͖̰̝͕̞̪̖͙͙̅̒̅̂̑́,̶̢̡̡̧̛̲̬̞̘̻̗̩̫̗͓̪̬͚̗̖͕̰̣͙͍̯͇̩̭͎̖̝̬̻͖̟̩̙̩̝͓̤́̄̆̍̂̈̊̄͆̽̑̑̊̓̋͐̔̉̍͌̏̀̿͘͜͜͜ͅͅ ̴̢̛̛͈͚̳̣̮̬̲̲͈̮͓̭̗̈́̽̄͌̾̒́̔̌̐̽͋̓̄̉̆̑̃́̏̉̔̓̂̽̊͆̽̎̍̈͑́̌͑̍̕͘͘͝͠ͅL̵̙̯̦̬̱͍̣̹̱̝̓̒i̵̢̨̨̧̨̛̗̲͍͇̖̥̯͔̙̪̱͓̝̦̼̭̬̟̞̩̭͙̐̐͊̒͑̊͌̽̂̉͊̈́̌͒̆̐͐͒̉̀́̑́̅͛͐̕̕͝͝ͅͅņ̵̛͓̲͆̏̃̊̒̇̑̑̾̽͊̃͌̔́̌̈́̈́͛͆̒̀̿̎͒̑̃̈́̈́͂͐͂̕̚̕͘͜͠͠ư̸̧̯̤̲͚͖̯͖͈̠̽̏̈́̄̀͒̐̅̽̋̓̂̑̋̽͒̄̑̇̈́̆̈͛͆̿̈̉͆͗͊̎͂̇̽̋̅͊̀̚̚͝ś̶̛̗̥͇̖̠͓͆̀̅̓̓͆͆̐́̄͛̃͑̔̑̒͒͋͂̂́͋͂́͗̐͆̐̕͝͝͠)
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
uint64_t addr;
|
||||
uint64_t size;
|
||||
} kernel_symbol_t;
|
||||
|
||||
#define EXPORT_SYMBOL(sym) \
|
||||
static const kernel_symbol_t __ksym_##sym \
|
||||
__attribute__((section(".ksyms"), used)) = { \
|
||||
.name = #sym, \
|
||||
.addr = (uint64_t)&sym, \
|
||||
.size = sizeof(sym) \
|
||||
}
|
||||
|
||||
extern const kernel_symbol_t __start_ksyms[];
|
||||
extern const kernel_symbol_t __stop_ksyms[];
|
Loading…
Add table
Add a link
Reference in a new issue