1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-27 11:24:34 -05:00

Rewrite some code according to glossary

This commit is contained in:
Braiden Vasco 2017-11-08 08:24:19 +00:00
parent c85dd61103
commit 193dd174d0
3 changed files with 9 additions and 9 deletions

View file

@ -75,11 +75,11 @@ unsigned long pfa_alloc_big_page()
return 0; return 0;
} }
void pfa_free_page(const unsigned long addr) void pfa_free_page(const unsigned long base)
{ {
assert(!(addr % PAGE_SIZE), "Small page address to free is not aligned."); assert(!(base % PAGE_SIZE), "Small page address to free is not aligned.");
const unsigned long i = addr / PAGE_SIZE; const unsigned long i = base / PAGE_SIZE;
if (i >= FRAMES_COUNT) { if (i >= FRAMES_COUNT) {
return; return;
@ -88,11 +88,11 @@ void pfa_free_page(const unsigned long addr)
frames[i] = 0; frames[i] = 0;
} }
void pfa_free_big_page(const unsigned long addr) void pfa_free_big_page(const unsigned long base)
{ {
assert(!(addr % PAGE_BIG_SIZE), "Big page address to free is not aligned."); assert(!(base % PAGE_BIG_SIZE), "Big page address to free is not aligned.");
const unsigned long start = addr / PAGE_SIZE; const unsigned long start = base / PAGE_SIZE;
const unsigned long end = start + PAGE_BIG_SIZE / PAGE_SIZE; const unsigned long end = start + PAGE_BIG_SIZE / PAGE_SIZE;
for (unsigned int i = start; i <= end && i < FRAMES_COUNT; ++i) { for (unsigned int i = start; i <= end && i < FRAMES_COUNT; ++i) {

View file

@ -8,7 +8,7 @@ void pfa_initialize(const struct KernelMQ_Info *kinfo);
unsigned long pfa_alloc_page(); unsigned long pfa_alloc_page();
unsigned long pfa_alloc_big_page(); unsigned long pfa_alloc_big_page();
void pfa_free_page(unsigned long addr); void pfa_free_page(unsigned long base);
void pfa_free_big_page(unsigned long addr); void pfa_free_big_page(unsigned long base);
#endif #endif

View file

@ -1,6 +1,6 @@
#ifndef KERNELMQ_INCLUDED_TASKS #ifndef KERNELMQ_INCLUDED_TASKS
#define KERNELMQ_INCLUDED_TASKS 1 #define KERNELMQ_INCLUDED_TASKS 1
void tasks_switch_to_user(unsigned long addr); void tasks_switch_to_user(unsigned long base);
#endif #endif