-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathklib.h
33 lines (30 loc) · 1.06 KB
/
klib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* klib.h
* Our klib 'library' header.
***********************************************************************
* This program is part of the source code released for the book
* "Linux Kernel Programming" 2E
* (c) Author: Kaiwan N Billimoria
* Publisher: Packt
* GitHub repository:
* https://github.com/PacktPublishing/Linux-Kernel-Programming_2E
***********************************************************************
* This kernel (module) header code is meant to serve as a 'library' of sorts.
* Other kernel modules in our codebase might wish to link into it and use
* it's code.
*
* For details, please refer the book.
*/
#ifndef __KLIB_LKP_H__
#define __KLIB_LKP_H__
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/io.h> /* virt_to_phys(), phys_to_virt(), ... */
int snprintf_lkp(char *buf, size_t maxsize, const char *fmt, ...);
void minsysinfo(void);
u64 powerof(int base, int exponent);
void show_phy_pages(void *kaddr, size_t len, bool contiguity_check);
void show_sizeof(void);
void delay_sec(long);
#endif