解决方案 »

  1.   

    上面有2类问题,一类问题是/home/wk/pmem.c:689:5: 错误: ‘get_pmem_user_addr’重定义
    /home/wk/android_pmem.h:78:19: 附注: ‘get_pmem_user_addr’的上一个定义在此另一种问题是
    /home/wk/pmem.c:813:3: 错误: 隐式声明函数‘dmac_flush_range’ [-Werror=implicit-function-declaration]
      

  2.   

     59 #ifdef CONFIG_ANDROID_PMEM
     60 int is_pmem_file(struct file *file);
     61 int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
     62                   unsigned long *end, struct file **filp);
     63 int get_pmem_user_addr(struct file *file, unsigned long *start,
     64                        unsigned long *end);
     65 void put_pmem_file(struct file* file);
     66 void flush_pmem_file(struct file *file, unsigned long start, unsigned long len);
     67 int pmem_setup(struct android_pmem_platform_data *pdata,
     68                long (*ioctl)(struct file *, unsigned int, unsigned long),
     69                int (*release)(struct inode *, struct file *));
     70 int pmem_remap(struct pmem_region *region, struct file *file,
     71                unsigned operation);
     72 
     73 #else
     74 static inline int is_ pmem_file(struct file *file) { return 0; }
     75 static inline int get_pmem_file(int fd, unsigned long *start,
     76                                 unsigned long *vstart, unsigned long *end,
     77                                 struct file **filp) { return -ENOSYS; }
     78 static inline int get_pmem_user_addr(struct file *file, unsigned long *start,
     79                                      unsigned long *end) { return -ENOSYS; }
     80 static inline void put_pmem_file(struct file* file) { return; }
     81 static inline void flush_pmem_file(struct file *file, unsigned long start,
     82                                    unsigned long len) { return; }
     83 static inline int pmem_setup(struct android_pmem_platform_data *pdata,
     84               long (*ioctl)(struct file *, unsigned int, unsigned long),
     85               int (*release)(struct inode *, struct file *)) { return -ENOSYS; }
     86 
     87 static inline int pmem_remap(struct pmem_region *region, struct file *file,
     88                              unsigned operation) { return -ENOSYS; }
     89 #endif