From caf5000333d37d2a772236bd6c3d539b0ee39c86 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Mon, 24 Jul 2006 16:34:55 +0000 Subject: major rework git-svn-id: https://svn.openpcd.org:2342/trunk@35 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/lib/changebit.S | 21 +++++++++++++++++++++ openpcd/firmware/lib/clearbit.S | 22 ++++++++++++++++++++++ openpcd/firmware/lib/lib_AT91SAM7.c | 25 +++++++++++++------------ openpcd/firmware/lib/setbit.S | 22 ++++++++++++++++++++++ openpcd/firmware/lib/testchangebit.S | 18 ++++++++++++++++++ openpcd/firmware/lib/testclearbit.S | 18 ++++++++++++++++++ openpcd/firmware/lib/testsetbit.S | 18 ++++++++++++++++++ 7 files changed, 132 insertions(+), 12 deletions(-) create mode 100644 openpcd/firmware/lib/changebit.S create mode 100644 openpcd/firmware/lib/clearbit.S create mode 100644 openpcd/firmware/lib/setbit.S create mode 100644 openpcd/firmware/lib/testchangebit.S create mode 100644 openpcd/firmware/lib/testclearbit.S create mode 100644 openpcd/firmware/lib/testsetbit.S (limited to 'openpcd/firmware/lib') diff --git a/openpcd/firmware/lib/changebit.S b/openpcd/firmware/lib/changebit.S new file mode 100644 index 0000000..7c709fb --- /dev/null +++ b/openpcd/firmware/lib/changebit.S @@ -0,0 +1,21 @@ +/* + * linux/arch/arm/lib/changebit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* Purpose : Function to change a bit + * Prototype: int change_bit(int bit, void *addr) + */ +ENTRY(_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_change_bit_le) + bitop eor diff --git a/openpcd/firmware/lib/clearbit.S b/openpcd/firmware/lib/clearbit.S new file mode 100644 index 0000000..cb48f7a --- /dev/null +++ b/openpcd/firmware/lib/clearbit.S @@ -0,0 +1,22 @@ +/* + * linux/arch/arm/lib/clearbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* + * Purpose : Function to clear a bit + * Prototype: int clear_bit(int bit, void *addr) + */ +ENTRY(_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_clear_bit_le) + bitop bic diff --git a/openpcd/firmware/lib/lib_AT91SAM7.c b/openpcd/firmware/lib/lib_AT91SAM7.c index f3e49d4..950761f 100644 --- a/openpcd/firmware/lib/lib_AT91SAM7.c +++ b/openpcd/firmware/lib/lib_AT91SAM7.c @@ -17,6 +17,7 @@ //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) //* +#include #include #include @@ -107,10 +108,10 @@ void AT91F_PDC_Open(AT91PS_PDC pPDC) // \arg pointer to a PDC controller AT91F_PDC_DisableTx(pPDC); //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); //* Enable the RX and TX PDC transfer requests AT91F_PDC_EnableRx(pPDC); @@ -128,10 +129,10 @@ void AT91F_PDC_Close(AT91PS_PDC pPDC) // \arg pointer to a PDC controller AT91F_PDC_DisableTx(pPDC); //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); } @@ -141,9 +142,9 @@ void AT91F_PDC_Close(AT91PS_PDC pPDC) // \arg pointer to a PDC controller //*---------------------------------------------------------------------------- unsigned int AT91F_PDC_SendFrame( AT91PS_PDC pPDC, - char *pBuffer, + const unsigned char *pBuffer, unsigned int szBuffer, - char *pNextBuffer, + const unsigned char *pNextBuffer, unsigned int szNextBuffer ) { if (AT91F_PDC_IsTxEmpty(pPDC)) { @@ -169,9 +170,9 @@ unsigned int AT91F_PDC_SendFrame( //*---------------------------------------------------------------------------- unsigned int AT91F_PDC_ReceiveFrame ( AT91PS_PDC pPDC, - char *pBuffer, + unsigned char *pBuffer, unsigned int szBuffer, - char *pNextBuffer, + unsigned char *pNextBuffer, unsigned int szNextBuffer ) { if (AT91F_PDC_IsRxEmpty(pPDC)) { diff --git a/openpcd/firmware/lib/setbit.S b/openpcd/firmware/lib/setbit.S new file mode 100644 index 0000000..9009bc1 --- /dev/null +++ b/openpcd/firmware/lib/setbit.S @@ -0,0 +1,22 @@ +/* + * linux/arch/arm/lib/setbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* + * Purpose : Function to set a bit + * Prototype: int set_bit(int bit, void *addr) + */ +ENTRY(_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_set_bit_le) + bitop orr diff --git a/openpcd/firmware/lib/testchangebit.S b/openpcd/firmware/lib/testchangebit.S new file mode 100644 index 0000000..37c303e --- /dev/null +++ b/openpcd/firmware/lib/testchangebit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testchangebit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_change_bit_le) + testop eor, strb diff --git a/openpcd/firmware/lib/testclearbit.S b/openpcd/firmware/lib/testclearbit.S new file mode 100644 index 0000000..985c399 --- /dev/null +++ b/openpcd/firmware/lib/testclearbit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testclearbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_clear_bit_le) + testop bicne, strneb diff --git a/openpcd/firmware/lib/testsetbit.S b/openpcd/firmware/lib/testsetbit.S new file mode 100644 index 0000000..4a8a164 --- /dev/null +++ b/openpcd/firmware/lib/testsetbit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testsetbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_set_bit_le) + testop orreq, streqb -- cgit v1.2.3