Commit be6b0267 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] swiotlb uninlinings

Optimise swiotlb.c for size.

   text    data     bss     dec     hex filename
   5009      89      64    5162    142a lib/swiotlb.o-before
   4666      89      64    4819    12d3 lib/swiotlb.o-after

For some reason my gcc (4.0.2) doesn't want to tailcall these things.

swiotlb_sync_sg_for_device:
	pushq	%rbp	#
	movl	$1, %r8d	#,
	movq	%rsp, %rbp	#,
	call	swiotlb_sync_sg	#
	leave
	ret
	.size	swiotlb_sync_sg_for_device, .-swiotlb_sync_sg_for_device
	.section	.text.swiotlb_sync_sg_for_cpu,"ax",@progbits
.globl swiotlb_sync_sg_for_cpu
	.type	swiotlb_sync_sg_for_cpu, @function
swiotlb_sync_sg_for_cpu:
	pushq	%rbp	#
	xorl	%r8d, %r8d	#
	movq	%rsp, %rbp	#,
	call	swiotlb_sync_sg	#
	leave
	ret

Cc: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 544fc728
...@@ -313,7 +313,7 @@ swiotlb_late_init_with_default_size(size_t default_size) ...@@ -313,7 +313,7 @@ swiotlb_late_init_with_default_size(size_t default_size)
#endif #endif
#ifndef SWIOTLB_ARCH_HAS_NEEDS_MAPPING #ifndef SWIOTLB_ARCH_HAS_NEEDS_MAPPING
static inline int static int
address_needs_mapping(struct device *hwdev, dma_addr_t addr) address_needs_mapping(struct device *hwdev, dma_addr_t addr)
{ {
dma_addr_t mask = 0xffffffff; dma_addr_t mask = 0xffffffff;
...@@ -672,7 +672,7 @@ swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, ...@@ -672,7 +672,7 @@ swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size,
* address back to the card, you must first perform a * address back to the card, you must first perform a
* swiotlb_dma_sync_for_device, and then the device again owns the buffer * swiotlb_dma_sync_for_device, and then the device again owns the buffer
*/ */
static inline void static void
swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr, swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr,
size_t size, int dir, int target) size_t size, int dir, int target)
{ {
...@@ -702,7 +702,7 @@ swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, ...@@ -702,7 +702,7 @@ swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
/* /*
* Same as above, but for a sub-range of the mapping. * Same as above, but for a sub-range of the mapping.
*/ */
static inline void static void
swiotlb_sync_single_range(struct device *hwdev, dma_addr_t dev_addr, swiotlb_sync_single_range(struct device *hwdev, dma_addr_t dev_addr,
unsigned long offset, size_t size, unsigned long offset, size_t size,
int dir, int target) int dir, int target)
...@@ -805,7 +805,7 @@ swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems, ...@@ -805,7 +805,7 @@ swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
* The same as swiotlb_sync_single_* but for a scatter-gather list, same rules * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules
* and usage. * and usage.
*/ */
static inline void static void
swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sg, swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sg,
int nelems, int dir, int target) int nelems, int dir, int target)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment