diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/backtrace.h | 2 | ||||
-rw-r--r-- | include/lib.h | 14 | ||||
-rw-r--r-- | include/memory.h | 30 | ||||
-rw-r--r-- | include/memory/physalloc.h | 8 |
4 files changed, 27 insertions, 27 deletions
diff --git a/include/backtrace.h b/include/backtrace.h index 57021db..913e256 100644 --- a/include/backtrace.h +++ b/include/backtrace.h @@ -7,7 +7,7 @@ size_t backtrace(void **dst, size_t len); // same as backtrace but with specified instruction and base pointer -size_t backtrace_ex(void **dst, size_t len, void* ip, void *bp); +size_t backtrace_ex(void **dst, size_t len, void *ip, void *bp); // Log a backtrace void log_backtrace(); diff --git a/include/lib.h b/include/lib.h index d808833..f60cf5e 100644 --- a/include/lib.h +++ b/include/lib.h @@ -92,25 +92,25 @@ int ctoi(char c); * @param s - the string to convert * @returns the number inside s or 0 on error */ -int atoi(const char* s); +int atoi(const char *s); /** * Converts the initial portiion of the string pointed to by s to long. * @param s - the string to convert * @returns the number inside s or 0 on error */ -long int atol(const char* s); +long int atol(const char *s); /** * Converts the initial portiion of the string pointed to by s to long long. * @param s - the string to convert * @returns the number inside s or 0 on error */ -long long int atoll(const char* s); +long long int atoll(const char *s); /** * Converts a integer to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to convert * @param buffer - the string buffer * @param radix - the base to convert */ @@ -118,7 +118,7 @@ char *itoa(int n, char *buffer, int radix); /** * Converts a long to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to convert * @param buffer - the string buffer * @param radix - the base to convert */ @@ -134,7 +134,7 @@ char *lltoa(long long int n, char *buffer, int radix); /** * Converts a unsigned integer to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to convert * @param buffer - the string buffer * @param radix - the base to convert */ @@ -142,7 +142,7 @@ char *utoa(unsigned int n, char *buffer, int radix); /** * Converts a unsigned long to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to convert * @param buffer - the string buffer * @param radix - the base to convert */ diff --git a/include/memory.h b/include/memory.h index cbed363..6ffe122 100644 --- a/include/memory.h +++ b/include/memory.h @@ -7,46 +7,46 @@ /** * Initalize system memory allocator */ -extern void memory_init(struct memory_map *map); +void memory_init(struct memory_map *map); /** * Disabled cpu interupts to not interfere with * current memory allocations. */ -extern void memory_lock(void); +void memory_lock(void); /** * Reenabled cpu interupts */ -extern void memory_unlock(void); +void memory_unlock(void); /** * @returns how much memory the system has */ -extern uint64_t memory_total(void); +uint64_t memory_total(void); /** * @returns how much memory is free */ -extern uint64_t memory_free(void); +uint64_t memory_free(void); /** * @returns how much memory is used */ -extern uint64_t memory_used(void); +uint64_t memory_used(void); /** * Allocates a single page in memory. * @returns the page if allocated or NULL on failure */ -extern void *alloc_page(void); +void *alloc_page(void); /** * Allocats count pages in memory * @param count - the number of continious pages to allocate * @returns the pages if allocated or NULL on failure */ -extern void *alloc_pages(int count); +void *alloc_pages(int count); /** * Frees a signle page in memory. @@ -54,7 +54,7 @@ extern void *alloc_pages(int count); * Freeing in the middle of a block is allowed. * @param page - the pointer to the page */ -extern void free_page(void *page); +void free_page(void *page); // TODO: implement free_page /** @@ -64,7 +64,7 @@ extern void free_page(void *page); * free_pages will from *page to end of block allocated. * @param page - the pointer to the page */ -extern void free_pages(void *page); +void free_pages(void *page); // TODO: implement freeing in middle of block /** @@ -76,21 +76,21 @@ extern void free_pages(void *page); * @param writable - if this memory should be writable * @param user - if this memory should be user writable */ -extern void *mmap(void *addr, size_t len); +void *mmap(void *addr, size_t len); /** * Unmaps mapped address from the mmap function * @param addr - the address returned from mmap * @param len - the length allocated */ -extern void unmap(void *addr); +void unmap(void *addr); /** * Allocates size_t bytes in memory * @param size - the amount of bytes to allocate * @retruns the address allocated or NULL on failure */ -extern void *kalloc(size_t size); +void *kalloc(size_t size); /** * Reallocates a given allocated ptr to a new size of bytes in memory. @@ -99,10 +99,10 @@ extern void *kalloc(size_t size); * @param size - the amount of bytes to set the pointer to * @returns the address allocated or NULL on failure */ -extern void *krealloc(void *ptr, size_t size); +void *krealloc(void *ptr, size_t size); /** * Frees a allocated pointer in memory * @param ptr - the pointer to free */ -extern void kfree(void *ptr); +void kfree(void *ptr); diff --git a/include/memory/physalloc.h b/include/memory/physalloc.h index f22432e..e95e418 100644 --- a/include/memory/physalloc.h +++ b/include/memory/physalloc.h @@ -8,23 +8,23 @@ * Allocates a single physical page in memory * @preturns the physical address of the page */ -extern void *alloc_phys_page(void); +void *alloc_phys_page(void); /** * Allocates count physical pages in memory * @returns the physical address of the first page */ -extern void *alloc_phys_pages(int count); +void *alloc_phys_pages(int count); /** * Frees a single physical page in memory * @param ptr - the physical address of the page */ -extern void free_phys_page(void *ptr); +void free_phys_page(void *ptr); /** * Frees count physical pages in memory * @param ptr - the physical address of the first page * @param count - the number of pages in the list */ -extern void free_phys_pages(void *ptr, int count); +void free_phys_pages(void *ptr, int count); |