欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

head.s分析(18):init_pda

系統 2436 0

快樂蝦

http://blog.csdn.net/lights_joy/

lights@hb165.com

本文適用于

ADI bf561 DSP

uclinux-2008r1.5-rc3 ( 移植到 vdsp5)

Visual DSP++ 5.0(update 5)

歡迎轉載,但請保留作者信息

sp += -12;

call _init_pda;

sp += 12;

init_pda 的定義在 linux-2.6.x\arch\blackfin\mm\init.c 文件中。這是 SMP 相關的代碼所調用的第一個函數。

PDA ,即 Per-processor Data Areas ,一看就知道是每個核的私有財產,呵呵。

asmlinkage void init_pda( void )

{

unsigned int cpu = raw_smp_processor_id();

/* Initialize the PDA fields holding references to other parts

of the memory. The content of such memory is still

undefined at the time of the call, we are only setting up

valid pointers to it. */

memset(cpu_pda, 0, sizeof (*cpu_pda));

#ifdef CONFIG_MPU

#else

write_pda(ipdt, ipdt_tables[cpu]);

#ifdef CONFIG_CPLB_INFO

write_pda(ipdt_swapcount, ipdt_swapcount_tables[cpu]);

write_pda(dpdt_swapcount, dpdt_swapcount_tables[cpu]);

#endif

write_pda(dpdt, dpdt_tables[cpu]);

#endif

write_pda(ex_stack, exception_stacks[cpu + 1]);

#ifdef CONFIG_SMP

write_pda(imask, 0x1f);

#endif

}

1.1.1 獲取 DSPID

首先,它調用了 raw_smp_processor_id 來獲取當前核的序號,對于 561 ,如果運行這段代碼的是 A 核,將返回 0 , B 核則返回 1

#define raw_smp_processor_id() blackfin_core_id()

#define blackfin_core_id() (bfin_read_DSPID() & 0xff)

#define bfin_read_DSPID() bfin_read32(DSPID)

DSPID

1.1.2 cpu_pda

cpu_pda 定義為:

#define cpu_pda (( struct blackfin_pda *)get_l1_scratch_start())

#define get_l1_scratch_start() get_l1_scratch_start_cpu(blackfin_core_id())

#define get_l1_scratch_start_cpu(cpu) \

({ unsigned long __addr; \

__addr = (cpu) ? L1_SCRATCH_COREB : L1_SCRATCH_COREA; \

__addr; })

即它將使用每個核各自的 l1 scratchpad(4k) 來存放私有數據。 cpu_pda 即指向這段存儲空間的最低位置,并將之轉換為 ( struct blackfin_pda *) 。看看這個結構體的定義:

/* Per-processor Data Areas are located at the start of the L1 scratch

memory, so that each can be accessed at a fixed address from the

current CPU. Used for SMP support and process stack checking. */

struct pda_task_info {

/* Points to the start of the stack. */

void *stack_start;

/* Not updated by the kernel; a user process can modify this to

keep track of the lowest address of the stack pointer during its

runtime. */

void *lowest_sp;

};

struct blackfin_pda { /* Per-processor Data Area */

struct pda_task_info task_info;

#ifdef CONFIG_SMP

unsigned long imask; /* Current IMASK value */

#endif

unsigned long *ipdt; /* Start of switchable I-CPLB table */

unsigned long *ipdt_swapcount; /* Number of swaps in ipdt */

unsigned long *dpdt; /* Start of switchable D-CPLB table */

unsigned long *dpdt_swapcount; /* Number of swaps in dpdt */

/*

* Single instructions can have multiple faults, which

* need to be handled by traps.c, in irq5. We store

* the exception cause to ensure we don't miss a

* double fault condition

*/

unsigned long ex_iptr;

unsigned long ex_optr;

unsigned long ex_buf[4];

unsigned long ex_imask; /* Saved imask from exception */

unsigned long *ex_stack; /* Exception stack space */

#ifdef ANOMALY_05000261

unsigned long last_cplb_fault_retx;

#endif

};

4K 的大小還遠著呢,還有擴展的潛力,呵呵。

1.1.3 write_pda

這個宏定義為:

#define write_pda(field, val) \

do { \

cpu_pda->field = val; \

} while (0)

就是對 cpu_pda 的各個字段賦值。

這里涉及的幾個數組,其定義如下:

u_long ipdt_tables[NR_CPUS][MAX_SWITCH_I_CPLBS+1];

u_long dpdt_tables[NR_CPUS][MAX_SWITCH_D_CPLBS+1];

#ifdef CONFIG_CPLB_INFO

u_long ipdt_swapcount_tables[NR_CPUS][MAX_SWITCH_I_CPLBS];

u_long dpdt_swapcount_tables[NR_CPUS][MAX_SWITCH_D_CPLBS];

#endif

extern unsigned long exception_stacks[NR_CPUS][1024];

head.s分析(18):init_pda


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。。?/p>

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产永久福利 | 一级视频片 | 亚洲一区免费在线观看 | 奇米影视第四色在线 | 免费a级毛片在线播放 | 在线播放亚洲 | 天天色天天射天天干 | 久久免费精品视频在线观看 | 欧美激情午夜 | 啪啪大片 | 日本污污视频在线观看 | 久久久精品视频免费看 | 杏导航aⅴ福利网站 | 欧美日韩一区二区三在线 | 欧美顶级毛片在线播放 | 免费国产va在线观看视频 | 日韩欧美亚洲一区 | 夜夜久久| 亚洲一区二区三区免费在线观看 | 91久久老司机福利精品网 | 青草视频在线观看免费资源 | 亚洲国产精品一区 | 黄色影视在线 | 国产一区二区三区在线免费观看 | 欧美日本一道高清二区三区 | 久久精品成人免费国产片桃视频 | 毛片网站在线 | 一区二区三区高清视频在线观看 | 久久久久在线观看 | 欧亚乱熟女一区二区在线 | 日韩精品视频在线观看免费 | 免费特黄一级欧美大片在线看 | 92精品国产自产在线 | 久草综合在线视频 | xxxxxx免费| 成人黄色网战 | 亚洲va国产va | 我和我的祖国电影在线观看免费版高清 | 一区二区三区免费视频 www | 国产不卡视频在线 | 亚洲综合在线另类色区奇米 |