outs.S 1.22 KB
Newer Older
Bryan Wu's avatar
Bryan Wu committed
1
/*
2
 * Implementation of outs{bwl} for BlackFin processors using zero overhead loops.
Bryan Wu's avatar
Bryan Wu committed
3
 *
4 5 6
 * Copyright 2005-2009 Analog Devices Inc.
 *                2005 BuyWays BV
 *                      Bas Vermeulen <bas@buyways.nl>
Bryan Wu's avatar
Bryan Wu committed
7
 *
8
 * Licensed under the GPL-2.
Bryan Wu's avatar
Bryan Wu committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 */

#include <linux/linkage.h>

.align 2

ENTRY(_outsl)
	P0 = R0;	/* P0 = port */
	P1 = R1;	/* P1 = address */
	P2 = R2;	/* P2 = count */

	LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
.Llong_loop_s: R0 = [P1++];
.Llong_loop_e: [P0] = R0;
	RTS;
24
ENDPROC(_outsl)
Bryan Wu's avatar
Bryan Wu committed
25 26 27 28 29 30 31 32 33 34

ENTRY(_outsw)
	P0 = R0;	/* P0 = port */
	P1 = R1;	/* P1 = address */
	P2 = R2;	/* P2 = count */

	LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
.Lword_loop_s: R0 = W[P1++];
.Lword_loop_e: W[P0] = R0;
	RTS;
35
ENDPROC(_outsw)
Bryan Wu's avatar
Bryan Wu committed
36 37 38 39 40 41 42 43 44 45

ENTRY(_outsb)
	P0 = R0;	/* P0 = port */
	P1 = R1;	/* P1 = address */
	P2 = R2;	/* P2 = count */

	LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
.Lbyte_loop_s: R0 = B[P1++];
.Lbyte_loop_e: B[P0] = R0;
	RTS;
46
ENDPROC(_outsb)
47 48 49 50 51 52 53 54 55 56 57 58 59

ENTRY(_outsw_8)
	P0 = R0;	/* P0 = port */
	P1 = R1;	/* P1 = address */
	P2 = R2;	/* P2 = count */

	LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
.Lword8_loop_s: R1 = B[P1++];
		R0 = B[P1++];
		R0 = R0 << 8;
		R0 = R0 + R1;
.Lword8_loop_e: W[P0] = R0;
	RTS;
60
ENDPROC(_outsw_8)