2010-12-1st

1. common usage macro for kernel list.

list_for_each_entry(pos, head, member)

@pos: the type * to use as a loop cursor

@head: the head for your list

@member: the name of the list_struct within the struct

 

2. error macro for driver common usage

ERR_PTR -> set error flag

IS_ERR -> judge if error occur

 

3. kernel resources management

struct resource *platform_get_resource (struct platform_device *dev, unsigned int type, unsigned int num) -> get resource for a device.

 

4. kernel clock management(recursion)

no clk controller available in FPGA

 

5. #define ioremap_nocache (cookie, size) __arm_ioremap(cookie, size, MT_DEVICE)

arch/arm/mm/ioremap.c -> void __iomem *__arm_ioremap (unsigned long phys_addr, size_t size, unsigned int mtype)

void __iomem *__arm_ioremap_pfn (unsigned long pfn, unsigned long offset, size_t size, unsigned int mtype)

remap_area_supersections/remap_area_sections/remap_area_pages

static inline void flush_cache_vmap (unsigned long start, unsigned long end)->used when creating mappings in kernel space for pages

PFN -> page frame number

 

6. VIPT (virtually-index-physically-tagged) cache

 

7. static inline const char *dev_name(const struct device *dev)

 

8. Macro definition for reduntant struct, eg:

#define SDMMC_PLATFORM_DATA(id, bits, clk, name)                      /

             static struct sd_slot slot_data_##id = {                             /

                        .pdev = &sirfsoc_sdmmc_device_##id,                    /

                        .bus_width = MMC_CAP_MAX_BUS_##bits##BITS, /

                        .clk_name = clk,                                                        /

                        .sdmmc_name = name,                                            /

              };

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值