还是尝试找了下头文件位置,参考linux内核目录介绍和搜索功能,添加了一些路径
# build pulse executable when user executes “make”
pulse: pulse.o
$(CC) $(LDFLAGS) pulse.o -o pulse
ABS_PATH = /home/ubt/tina-d1-h/lichee/linux-5.4/
# linux/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/include/
# uapi/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/
# asm/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/arch/riscv/include
# asm/xxx路径2 -I/home/ubt/tina-d1-h/lichee/linux-5.4/arch/riscv/include/generated
# linux/xxx路径2-I/home/ubt/tina-d1-h/lichee/linux-5.4/include/uapi/
INC = -I$(ABS_PATH) -I$(ABS_PATH)include/ -I$(ABS_PATH)arch/riscv/include/ -I$(ABS_PATH)/arch/riscv/include/generated/ -I$(ABS_PATH)include/uapi/
pulse.o: pulse.c
$(CC) $(CFLAGS) $(INC) -c pulse.c
# remove object files and executable when user executes “make clean”
clean:
rm *.o pulse
编译出现了大量错误
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:68:1: warning: empty declaration [enabled by default]
struct pcpu_group_info {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:75:1: warning: empty declaration [enabled by default]
struct pcpu_alloc_info {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:87:1: warning: empty declaration [enabled by default]
enum pcpu_fc {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:94:27: error: storage class specified for parameter ‘pcpu_fc_names’
extern const char * const pcpu_fc_names[PCPU_FC_NR];
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:96:21: error: storage class specified for parameter ‘pcpu_chosen_fc’
extern enum pcpu_fc pcpu_chosen_fc;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:98:18: error: storage class specified for parameter ‘pcpu_fc_alloc_fn_t’
typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:100:16: error: storage class specified for parameter ‘pcpu_fc_free_fn_t’
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:101:16: error: storage class specified for parameter ‘pcpu_fc_populate_pte_fn_t’
typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:102:14: error: storage class specified for parameter ‘pcpu_fc_cpu_distance_fn_t’
typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0,
from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15,
from pulse.c:14:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token
#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:104:33: note: in expansion of macro ‘__init’
extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token
#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:106:13: note: in expansion of macro ‘__init’
extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token
#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:108:13: note: in expansion of macro ‘__init’
extern void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19:0,
from pulse.c:16:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:126:23: error: storage class specified for parameter ‘__alloc_reserved_percpu’
extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:127:13: error: storage class specified for parameter ‘__is_kernel_percpu_address’
extern bool __is_kernel_percpu_address(unsigned long addr, unsigned long *can_addr);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:128:13: error: storage class specified for parameter ‘is_kernel_percpu_address’
extern bool is_kernel_percpu_address(unsigned long addr);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0,
from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15,
from pulse.c:14:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token
#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:131:13: note: in expansion of macro ‘__init’
extern void __init setup_per_cpu_areas(void);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19:0,
from pulse.c:16:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:134:23: error: storage class specified for parameter ‘__alloc_percpu_gfp’
extern void __percpu *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:135:23: error: storage class specified for parameter ‘__alloc_percpu’
extern void __percpu *__alloc_percpu(size_t size, size_t align);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:136:13: error: storage class specified for parameter ‘free_percpu’
extern void free_percpu(void __percpu *__pdata);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:137:20: error: storage class specified for parameter ‘per_cpu_ptr_to_phys’
extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:146:22: error: storage class specified for parameter ‘pcpu_nr_pages’
extern unsigned long pcpu_nr_pages(void);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:21:0,
from pulse.c:16:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:11:2: error: expected specifier-qualifier-list before ‘ktime_t’
ktime_t expires;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:9:1: warning: empty declaration [enabled by default]
struct timerqueue_node {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:14:1: warning: empty declaration [enabled by default]
struct timerqueue_head {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:19:13: error: storage class specified for parameter ‘timerqueue_add’
extern bool timerqueue_add(struct timerqueue_head *head,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:21:13: error: storage class specified for parameter ‘timerqueue_del’
extern bool timerqueue_del(struct timerqueue_head *head,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:23:32: error: storage class specified for parameter ‘timerqueue_iterate_next’
extern struct timerqueue_node *timerqueue_iterate_next(
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:35:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:42:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:47:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:52:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:57:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
In file included from pulse.c:16:0:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:24:1: warning: empty declaration [enabled by default]
struct hrtimer_clock_base;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:25:1: warning: empty declaration [enabled by default]
struct hrtimer_cpu_base;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:39:1: warning: empty declaration [enabled by default]
enum hrtimer_mode {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:65:1: warning: empty declaration [enabled by default]
enum hrtimer_restart {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:120:2: error: expected specifier-qualifier-list before ‘ktime_t’
ktime_t _softexpires;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:118:1: warning: empty declaration [enabled by default]
struct hrtimer {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:138:1: warning: empty declaration [enabled by default]
struct hrtimer_sleeper {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:165:2: error: expected specifier-qualifier-list before ‘seqcount_t’
seqcount_t seq;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:161:1: warning: empty declaration [enabled by default]
struct hrtimer_clock_base {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:172:1: warning: empty declaration [enabled by default]
enum hrtimer_base_type {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:217:2: error: expected specifier-qualifier-list before ‘raw_spinlock_t’
raw_spinlock_t lock;
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:216:1: warning: empty declaration [enabled by default]
struct hrtimer_cpu_base {
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:242:63: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:248:69: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:248:83: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:254:72: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, u64 delta)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:261:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:266:63: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:273:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:278:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_expires’
static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:283:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_softexpires’
static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:289:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:293:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:298:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:302:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_expires_remaining’
static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:307:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_cb_get_time’
static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:313:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:331:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
static inline void clock_was_set_delayed(void) { }
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:336:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__hrtimer_expires_remaining_adjusted’
__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:350:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_expires_remaining_adjusted’
hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:356:13: error: storage class specified for parameter ‘clock_was_set’
extern void clock_was_set(void);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:360:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
static inline void timerfd_clock_was_set(void) { }
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:362:13: error: storage class specified for parameter ‘hrtimers_resume’
extern void hrtimers_resume(void);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/asm-generic/percpu.h:7:0,
from /home/ubt/tina-d1-h/lichee/linux-5.4//arch/riscv/include/generated/asm/percpu.h:1,
from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:13,
from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19,
from pulse.c:16:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:37: error: storage class specified for parameter ‘tick_cpu_device’
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu-defs.h:101:44: note: in definition of macro ‘DECLARE_PER_CPU_SECTION’
extern __PCPU_ATTRS(sec) __typeof__(type) name
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:1: note: in expansion of macro ‘DECLARE_PER_CPU’
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:37: error: section attribute not allowed for ‘tick_cpu_device’
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu-defs.h:101:44: note: in definition of macro ‘DECLARE_PER_CPU_SECTION’
extern __PCPU_ATTRS(sec) __typeof__(type) name
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:1: note: in expansion of macro ‘DECLARE_PER_CPU’
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
^
In file included from pulse.c:16:0:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:370:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:378:13: error: storage class specified for parameter ‘hrtimer_init’
extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:380:13: error: storage class specified for parameter ‘hrtimer_init_sleeper’
extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:395:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:402:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:406:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:410:59: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:421:57: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:427:12: error: storage class specified for parameter ‘hrtimer_cancel’
extern int hrtimer_cancel(struct hrtimer *timer);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:428:12: error: storage class specified for parameter ‘hrtimer_try_to_cancel’
extern int hrtimer_try_to_cancel(struct hrtimer *timer);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:432:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:445:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:450:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__hrtimer_get_remaining’
extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:452:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_remaining’
static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:457:12: error: storage class specified for parameter ‘hrtimer_get_next_event’
extern u64 hrtimer_get_next_event(void);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:458:12: error: storage class specified for parameter ‘hrtimer_next_event_without’
extern u64 hrtimer_next_event_without(const struct hrtimer *exclude);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:460:13: error: storage class specified for parameter ‘hrtimer_active’
extern bool hrtimer_active(const struct hrtimer *timer);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:471:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:481:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:487:40: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:487:53: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:506:11: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
ktime_t interval)
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:513:12: error: storage class specified for parameter ‘nanosleep_copyout’
extern int nanosleep_copyout(struct restart_block *, struct timespec64 *);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:514:13: error: storage class specified for parameter ‘hrtimer_nanosleep’
extern long hrtimer_nanosleep(const struct timespec64 *rqtp,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:518:37: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:520:43: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:524:31: error: expected declaration specifiers or ‘...’ before ‘ktime_t’
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:527:13: error: storage class specified for parameter ‘hrtimer_run_queues’
extern void hrtimer_run_queues(void);
^
In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0,
from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15,
from pulse.c:14:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token
#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi
^
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:530:13: note: in expansion of macro ‘__init’
extern void __init hrtimers_init(void);
^
In file included from pulse.c:16:0:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:533:13: error: storage class specified for parameter ‘sysrq_timer_list_show’
extern void sysrq_timer_list_show(void);
^
pulse.c:19:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
In file included from pulse.c:14:0:
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:328:6: error: old-style parameter declarations in prototyped function definition
void do_exit(long error_code) __noreturn;
^
pulse.c:22:1: error: expected ‘{’ at end of input
}
^
make: *** [pulse.o] Error 1
[2]+ Done $T/tools/build/buildserver --path $T 2> /dev/null 1>&2
可以确定肯定不是这么搞的,我还是再去学习下怎么添加驱动程序看看