History

kdb: use kmap_local_page()

Use kmap_local_page() instead of kmap_atomic() which has been deprecated.

Zhang Heng committed 1 year ago

Commit 36975ec1 parent 9d895511 file · +3 −3Browse files

Showing the changes to kernel/debug (1 of 1 file). Show all

Unified · Split

kernel/debug/kdb/kdb_support.c+3−3
@@ -305,7 +305,7 @@ int kdb_putarea_size(unsigned long addr, void *res, size_t size) · 304 unmodified lines
305 305
306/*306/*
307 * kdb_getphys - Read data from a physical address. Validate the307 * kdb_getphys - Read data from a physical address. Validate the
308 * address is in range, use kmap_atomic() to get data308 * address is in range, use kmap_local_page() to get data
309 * similar to kdb_getarea() - but for phys addresses309 * similar to kdb_getarea() - but for phys addresses
310 * Inputs:310 * Inputs:
311 * res Pointer to the word to receive the result311 * res Pointer to the word to receive the result
@@ -324,9 +324,9 @@ static int kdb_getphys(void *res, unsigned long addr, size_t size) · 12 unmodified lines
324 if (!pfn_valid(pfn))324 if (!pfn_valid(pfn))
325 return 1;325 return 1;
326 page = pfn_to_page(pfn);326 page = pfn_to_page(pfn);
327 vaddr = kmap_atomic(page);327 vaddr = kmap_local_page(page);
328 memcpy(res, vaddr + (addr & (PAGE_SIZE - 1)), size);328 memcpy(res, vaddr + (addr & (PAGE_SIZE - 1)), size);
329 kunmap_atomic(vaddr);329 kunmap_local(vaddr);
330 330
331 return 0;331 return 0;
332}332}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t