Skip to content

Commit

Permalink
Rename user_paddr_t -> paddr_t
Browse files Browse the repository at this point in the history
  • Loading branch information
phaubertin committed Jan 26, 2025
1 parent 2f222b1 commit 25a862a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/kernel/infrastructure/i686/exports/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
/** Physical memory address for use by the kernel */
typedef uint32_t kern_paddr_t;

/** Physical memory address for use by user space */
typedef uint64_t user_paddr_t;
/** Physical memory address */
typedef uint64_t paddr_t;

#define PRIxKPADDR PRIx32

Expand Down
2 changes: 1 addition & 1 deletion include/kernel/machine/pmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool machine_map_userspace(
process_t *process,
void *vaddr,
size_t length,
user_paddr_t paddr,
paddr_t paddr,
int prot);

bool machine_clone_userspace_mapping(
Expand Down
2 changes: 1 addition & 1 deletion kernel/infrastructure/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ bool elf_check(Elf32_Ehdr *ehdr) {
static void checked_map_userspace_page(
process_t *process,
void *vaddr,
user_paddr_t paddr,
paddr_t paddr,
int flags) {

/* TODO check user space pointers
Expand Down
12 changes: 6 additions & 6 deletions kernel/infrastructure/i686/pmap/pmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void copy_ptes(pte_t *dest, const pte_t *src, int n) {
* @param paddr physical address of page frame
* @param flags flags
*/
static void set_pte(pte_t *pte, user_paddr_t paddr, uint64_t flags) {
static void set_pte(pte_t *pte, paddr_t paddr, uint64_t flags) {
if(pgtable_format_pae) {
pae_set_pte(pte, paddr, flags);
}
Expand Down Expand Up @@ -256,7 +256,7 @@ void clear_ptes(pte_t *pte, int n) {
* @param pte page table or page directory entry array
* @return physical address
*/
static user_paddr_t get_pte_paddr(const pte_t *pte) {
static paddr_t get_pte_paddr(const pte_t *pte) {
if(pgtable_format_pae) {
return pae_get_pte_paddr(pte);
}
Expand Down Expand Up @@ -743,7 +743,7 @@ static uint64_t map_page_access_flags(int prot) {
static bool map_page(
addr_space_t *addr_space,
void *vaddr,
user_paddr_t paddr,
paddr_t paddr,
uint64_t flags) {

/** ASSERTION: we assume vaddr is aligned on a page boundary */
Expand Down Expand Up @@ -799,7 +799,7 @@ void machine_map_kernel_page(void *vaddr, kern_paddr_t paddr, int prot) {
static bool map_userspace_page(
addr_space_t *addr_space,
void *vaddr,
user_paddr_t paddr,
paddr_t paddr,
int prot) {

assert(is_userspace_pointer(vaddr));
Expand All @@ -823,7 +823,7 @@ bool machine_map_userspace(
process_t *process,
void *vaddr,
size_t length,
user_paddr_t paddr,
paddr_t paddr,
int prot) {

addr_t addr = vaddr;
Expand Down Expand Up @@ -917,7 +917,7 @@ bool machine_clone_userspace_mapping(
unmap_page(dest_addr_space, dest_addr);
}
else {
user_paddr_t paddr = get_pte_paddr(src_pte);
paddr_t paddr = get_pte_paddr(src_pte);

if(!map_userspace_page(dest_addr_space, dest_addr, paddr, prot)) {
return false;
Expand Down

0 comments on commit 25a862a

Please sign in to comment.