函数逻辑报告 | 
Source Code:arch\x86\kernel\cpu\mtrr\mtrr.c | 
Create Date:2022-07-27 09:05:23 | 
| Last Modify:2022-05-18 17:35:08 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:mtrr_add_page - Add a memory type region*@base: Physical base address of region in pages (in units of 4 kB!)*@size: Physical size of region in pages (4 kB)*@type: Type of MTRR desired*@increment: If this is true do usage counting on the region* Memory
函数原型:int mtrr_add_page(unsigned long base, unsigned long size, unsigned int type, bool increment)
返回类型:int
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| unsigned long | base | |
| unsigned long | size | |
| unsigned int | type | |
| bool | increment | 
| 308 | 如果非mtrr_enabled()则返回:负ENXIO | 
| 311 | error等于validate_add_page(base, size, type) | 
| 315 | 如果type大于等于MTRR_NUM_TYPES则 | 
| 326 | 如果非size则 | 
| 331 | 如果base按位或base加size减1的值右移x86_phys_bits减PAGE_SHIFT determines the page size 位则 | 
| 338 | replace等于负1 | 
| 341 | get_online_cpus() | 
| 344 | mutex_lock( & mtrr_mutex) | 
| 345 | 以i小于num_var_ranges循环 | 
| 361 | 否则如果types_compatible(type, ltype)则继续下一循环 | 
| 366 | 转到:out | 
| 370 | 如果types_compatible(type, ltype)则继续下一循环 | 
| 372 | 打印警告信息("type mismatch for %lx000,%lx000 old: %s new: %s\n", base, size, mtrr_attrib_to_str(ltype), mtrr_attrib_to_str(type)) | 
| 375 | 转到:out | 
| 377 | 如果increment则mtrr_usage_table[i]先自加 | 
| 380 | 转到:out | 
| 383 | i等于get_free_region(base, size, replace) | 
| 384 | 如果i大于等于0则 | 
| 385 | set_mtrr_cpuslocked(i, base, size, type) | 
| 386 | 如果此条件成立可能性大(为编译器优化)(replace < 0)则 | 
| 387 | mtrr_usage_table[i]等于1 | 
| 388 | 否则 | 
| 389 | mtrr_usage_table[i]等于mtrr_usage_table[replace] | 
| 390 | 如果increment则mtrr_usage_table[i]自加 | 
| 392 | 如果此条件成立可能性小(为编译器优化)(replace != i)则 | 
| 393 | set_mtrr_cpuslocked(replace, 0, 0, 0) | 
| 394 | mtrr_usage_table[replace]等于0 | 
| 397 | 否则 | 
| 398 | 打印信息("no more MTRRs available\n") | 
| 401 | out : | 
| 402 | mutex_unlock( & mtrr_mutex) | 
| 403 | put_online_cpus() | 
| 404 | 返回:error | 
| 名称 | 描述 | 
|---|---|
| mtrr_add | mtrr_add - Add a memory type region*@base: Physical base address of region*@size: Physical size of region*@type: Type of MTRR desired*@increment: If this is true do usage counting on the region* Memory type region registers control the caching on newer | 
| mtrr_file_add | |
| mtrr_write | seq_file can seek but we ignore it.* Format of control line:* "base=%Lx size=%Lx type=%s" or "disable=%d" | 
| mtrr_ioctl | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |