Function report |
Source Code:arch\x86\kernel\cpu\mtrr\mtrr.c |
Create Date:2022-07-28 08:05:08 |
| Last Modify:2022-05-18 17:35:08 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto:int mtrr_add_page(unsigned long base, unsigned long size, unsigned int type, bool increment)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned long | base | |
| unsigned long | size | |
| unsigned int | type | |
| bool | increment |
| 308 | If Not mtrr_enabled() Then Return -ENXIO |
| 311 | error = validate_add_page(base, size, type) |
| 315 | If type >= MTRR_NUM_TYPES Then |
| 321 | If type == MTRR_TYPE_WRCOMB && Not Returns non-zero if we have the write-combining memory type Then |
| 326 | If Not size Then |
| 331 | If (base | base + size - 1 ) >> x86_phys_bits - PAGE_SHIFT determines the page size Then |
| 338 | replace = -1 |
| 341 | get_online_cpus() |
| 344 | mutex_lock( & mtrr_mutex) |
| 345 | When i < num_var_ranges cycle |
| 361 | Else if types_compatible(type, ltype) Then Continue |
| 366 | Go to out |
| 370 | If types_compatible(type, ltype) Then Continue |
| 372 | pr_warn("type mismatch for %lx000,%lx000 old: %s new: %s\n", base, size, mtrr_attrib_to_str(ltype), mtrr_attrib_to_str(type)) |
| 375 | Go to out |
| 377 | If increment Then ++mtrr_usage_table[i] |
| 380 | Go to out |
| 383 | i = get_free_region(base, size, replace) |
| 384 | If i >= 0 Then |
| 385 | set_mtrr_cpuslocked(i, base, size, type) |
| 386 | If Value is more likely to compile time(replace < 0) Then |
| 387 | mtrr_usage_table[i] = 1 |
| 388 | Else |
| 389 | mtrr_usage_table[i] = mtrr_usage_table[replace] |
| 390 | If increment Then mtrr_usage_table[i]++ |
| 392 | If Value for the false possibility is greater at compile time(replace != i) Then |
| 393 | set_mtrr_cpuslocked(replace, 0, 0, 0) |
| 394 | mtrr_usage_table[replace] = 0 |
| 397 | Else |
| 398 | pr_info("no more MTRRs available\n") |
| 401 | out : |
| 402 | mutex_unlock( & mtrr_mutex) |
| 403 | put_online_cpus() |
| 404 | Return error |
| Name | Describe |
|---|---|
| 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 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |