Skip to content

Commit

Permalink
Merge pull request #34 from d-we/master
Browse files Browse the repository at this point in the history
Move Func Pointer declaration to private Translation Unit
  • Loading branch information
misc0110 authored Aug 28, 2023
2 parents ac93b63 + b1e49c7 commit 37c7dce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: pteditor ptedit.o example header tests
header: module/pteditor.c module/pteditor.h ptedit.c ptedit.h
echo "#pragma once" > ptedit_header.h
cat module/pteditor.h ptedit.h ptedit.c | \
sed -e 's/#include ".*"//g' -e "1i // Warning: this file was generated by make. DO NOT EDIT!" | sed 's/#define ptedit_fnc/#define ptedit_fnc static/g' >> ptedit_header.h
sed -e 's/#include ".*"//g' -e "1i // Warning: this file was generated by make. DO NOT EDIT!" | sed 's/extern //g'| sed 's/#define ptedit_fnc/#define ptedit_fnc static/g' >> ptedit_header.h

pteditor: module/pteditor.c
cd module && make
Expand Down
4 changes: 4 additions & 0 deletions ptedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ typedef struct {
static ptedit_paging_definition_t ptedit_paging_definition;


// ---------------------------------------------------------------------------
ptedit_fnc ptedit_resolve_t ptedit_resolve;
ptedit_fnc ptedit_update_t ptedit_update;


// ---------------------------------------------------------------------------
ptedit_fnc ptedit_entry_t ptedit_resolve_kernel(void* address, pid_t pid) {
Expand Down
4 changes: 2 additions & 2 deletions ptedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ typedef void (*ptedit_update_t)(void*, pid_t, ptedit_entry_t*);
*
* @return A structure containing the page-table entries of all levels.
*/
ptedit_fnc ptedit_resolve_t ptedit_resolve;
extern ptedit_fnc ptedit_resolve_t ptedit_resolve;

/**
* Updates one or more page-table entries for a virtual address of a given process.
Expand All @@ -234,7 +234,7 @@ ptedit_fnc ptedit_resolve_t ptedit_resolve;
* @param[in] vm A structure containing the values for the page-table entries and a bitmask indicating which entries to update
*
*/
ptedit_fnc ptedit_update_t ptedit_update;
extern ptedit_fnc ptedit_update_t ptedit_update;

/**
* Sets a bit directly in the PTE of an address.
Expand Down

0 comments on commit 37c7dce

Please sign in to comment.