Function report |
Source Code:arch\x86\kernel\amd_gart_64.c |
Create Date:2022-07-28 08:52:26 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:DMA map all entries in a scatterlist.* Merge chunks that have page aligned sizes into a continuous mapping.
Proto:static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, unsigned long attrs)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct device * | dev | |
| struct scatterlist * | sg | |
| int | nents | |
| enum dma_data_direction | dir | |
| unsigned long | attrs |
| 384 | need = 0 |
| 385 | pages = 0 |
| 389 | If nents == 0 Then Return 0 |
| 392 | out = 0 |
| 393 | start = 0 |
| 396 | seg_size = 0 |
| 397 | max_seg_size = dma_get_max_seg_size(dev) |
| 398 | ps = NULL |
| 403 | dma_address = addr |
| 406 | nextneed = need_iommu(dev, addr, length) |
| 415 | If Not iommu_merge || Not nextneed || Not need || offset || length + seg_size > max_seg_size || (offset + length) % PAGE_SIZE Then |
| 421 | out++ |
| 423 | seg_size = 0 |
| 425 | pages = 0 |
| 433 | pages += iommu_num_pages(offset, length, PAGE_SIZE) |
| 438 | out++ |
| 442 | dma_length = 0 |
| 444 | Return out |
| 446 | error : |
| 451 | If force_iommu || iommu_merge Then |
| 456 | If panic_on_overflow Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 459 | iommu_full(dev, pages << PAGE_SHIFT determines the page size , dir) |
| 461 | dma_address = DMA_MAPPING_ERROR |
| 462 | Return 0 |
| 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 |