硬是在动态映射或者静态映射后,只能读不能写,逼着我对ioremap刨根问底
1、\arch\alpha\include\asm\io.h
static inline void __iomem *ioremap(unsigned long port, unsigned long size)
{
return IO_CONCAT(__IO_PREFIX,ioremap) (port, size);
}
寻找IO_CONCAT在同一文件中
#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
#define _IO_CONCAT(a,b) a ## _ ## b
寻找__IO_PREFIX在同一文件
#define __IO_PREFIX generic
由以上代码得出有generic_ioremap(unsigned long port, unsigned long size)函数存在,寻找该函数在同一文件中
static inline void __iomem *generic_ioremap(unsigned long a, unsigned long s)
{
return alpha_mv.mv_ioremap(a, s);
}
寻找alpha_mv结构体中的mv_ioremap()函数
arch\alpha\kernel\setup.c中如下
struct alpha_machine_vector alpha_mv;
查找结构体定义alpha_machine_vector到\arch\alpha\include\asm\machvec.h中
struct alpha_machine_vector
{
/* This "belongs" down below with the rest of the runtime
variables, but it is convenient for entry.S if these
two slots are at the beginning of the struct. */
unsigned long hae_cache;
unsigned long *hae_register;
int nr_irqs;
int rtc_port;
unsigned int max_asn;
unsigned long max_isa_dma_address;
unsigned long irq_probe_mask;
unsigned long iack_sc;
unsigned long min_io_address;