mbed w/ spi bug fig

Dependents:   display-puck

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Jun 17 11:00:07 2014 +0100
Revision:
232:1e593fe58241
Synchronized with git revision 990a82a00808c8148a6e542650e5f5fe9339ea9f

Full URL: https://github.com/mbedmicro/mbed/commit/990a82a00808c8148a6e542650e5f5fe9339ea9f/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 232:1e593fe58241 1 //*****************************************************************************
mbed_official 232:1e593fe58241 2 // aeabi_romdiv_patch.s
mbed_official 232:1e593fe58241 3 // - Provides "patch" versions of the aeabi integer divide functions to
mbed_official 232:1e593fe58241 4 // replace the standard ones pulled in from the C library, which vector
mbed_official 232:1e593fe58241 5 // integer divides onto the rom division functions contained in
mbed_official 232:1e593fe58241 6 // specific NXP MCUs such as LPC11Uxx and LPC12xx.
mbed_official 232:1e593fe58241 7 // - Note that this patching will only occur if "__USE_ROMDIVIDE" is
mbed_official 232:1e593fe58241 8 // defined for the project build for both the compiler and assembler.
mbed_official 232:1e593fe58241 9 //*****************************************************************************
mbed_official 232:1e593fe58241 10 //
mbed_official 232:1e593fe58241 11 // Copyright(C) NXP Semiconductors, 2013
mbed_official 232:1e593fe58241 12 // All rights reserved.
mbed_official 232:1e593fe58241 13 //
mbed_official 232:1e593fe58241 14 // Software that is described herein is for illustrative purposes only
mbed_official 232:1e593fe58241 15 // which provides customers with programming information regarding the
mbed_official 232:1e593fe58241 16 // LPC products. This software is supplied "AS IS" without any warranties of
mbed_official 232:1e593fe58241 17 // any kind, and NXP Semiconductors and its licensor disclaim any and
mbed_official 232:1e593fe58241 18 // all warranties, express or implied, including all implied warranties of
mbed_official 232:1e593fe58241 19 // merchantability, fitness for a particular purpose and non-infringement of
mbed_official 232:1e593fe58241 20 // intellectual property rights. NXP Semiconductors assumes no responsibility
mbed_official 232:1e593fe58241 21 // or liability for the use of the software, conveys no license or rights under any
mbed_official 232:1e593fe58241 22 // patent, copyright, mask work right, or any other intellectual property rights in
mbed_official 232:1e593fe58241 23 // or to any products. NXP Semiconductors reserves the right to make changes
mbed_official 232:1e593fe58241 24 // in the software without notification. NXP Semiconductors also makes no
mbed_official 232:1e593fe58241 25 // representation or warranty that such application will be suitable for the
mbed_official 232:1e593fe58241 26 // specified use without further testing or modification.
mbed_official 232:1e593fe58241 27 //
mbed_official 232:1e593fe58241 28 // Permission to use, copy, modify, and distribute this software and its
mbed_official 232:1e593fe58241 29 // documentation is hereby granted, under NXP Semiconductors' and its
mbed_official 232:1e593fe58241 30 // licensor's relevant copyrights in the software, without fee, provided that it
mbed_official 232:1e593fe58241 31 // is used in conjunction with NXP Semiconductors microcontrollers. This
mbed_official 232:1e593fe58241 32 // copyright, permission, and disclaimer notice must appear in all copies of
mbed_official 232:1e593fe58241 33 // this code.
mbed_official 232:1e593fe58241 34 //*****************************************************************************
mbed_official 232:1e593fe58241 35 #if defined(__USE_ROMDIVIDE)
mbed_official 232:1e593fe58241 36
mbed_official 232:1e593fe58241 37 // Note that the romdivide "divmod" functions are not actually called from
mbed_official 232:1e593fe58241 38 // the below code, as these functions are actually just wrappers to the
mbed_official 232:1e593fe58241 39 // main romdivide "div" functions which push the quotient and remainder onto
mbed_official 232:1e593fe58241 40 // the stack, so as to be compatible with the way that C returns structures.
mbed_official 232:1e593fe58241 41 //
mbed_official 232:1e593fe58241 42 // This is not needed for the aeabi "divmod" functions, as the compiler
mbed_official 232:1e593fe58241 43 // automatically generates code that handles the return values being passed
mbed_official 232:1e593fe58241 44 // back in registers when it generates inline calls to __aeabi_idivmod and
mbed_official 232:1e593fe58241 45 // __aeabi_uidivmod routines.
mbed_official 232:1e593fe58241 46
mbed_official 232:1e593fe58241 47 .syntax unified
mbed_official 232:1e593fe58241 48 .text
mbed_official 232:1e593fe58241 49
mbed_official 232:1e593fe58241 50 // ========= __aeabi_idiv & __aeabi_idivmod =========
mbed_official 232:1e593fe58241 51 .align 2
mbed_official 232:1e593fe58241 52 .section .text.__aeabi_idiv
mbed_official 232:1e593fe58241 53
mbed_official 232:1e593fe58241 54 .global __aeabi_idiv
mbed_official 232:1e593fe58241 55 .set __aeabi_idivmod, __aeabi_idiv // make __aeabi_uidivmod an alias
mbed_official 232:1e593fe58241 56 .global __aeabi_idivmod
mbed_official 232:1e593fe58241 57 .global pDivRom_idiv // pointer to the romdivide 'idiv' functione
mbed_official 232:1e593fe58241 58 .func
mbed_official 232:1e593fe58241 59 .thumb_func
mbed_official 232:1e593fe58241 60 .type __aeabi_idiv, %function
mbed_official 232:1e593fe58241 61
mbed_official 232:1e593fe58241 62 __aeabi_idiv:
mbed_official 232:1e593fe58241 63 push {r4, lr}
mbed_official 232:1e593fe58241 64 ldr r3, =pDivRom_idiv
mbed_official 232:1e593fe58241 65 ldr r3, [r3, #0] // Load address of function
mbed_official 232:1e593fe58241 66 blx r3 // Call divide function
mbed_official 232:1e593fe58241 67 pop {r4, pc}
mbed_official 232:1e593fe58241 68
mbed_official 232:1e593fe58241 69 .endfunc
mbed_official 232:1e593fe58241 70
mbed_official 232:1e593fe58241 71 // ======== __aeabi_uidiv & __aeabi_uidivmod ========
mbed_official 232:1e593fe58241 72 .align 2
mbed_official 232:1e593fe58241 73
mbed_official 232:1e593fe58241 74 .section .text.__aeabi_uidiv
mbed_official 232:1e593fe58241 75
mbed_official 232:1e593fe58241 76 .global __aeabi_uidiv
mbed_official 232:1e593fe58241 77 .set __aeabi_uidivmod, __aeabi_uidiv // make __aeabi_uidivmod an alias
mbed_official 232:1e593fe58241 78 .global __aeabi_uidivmod
mbed_official 232:1e593fe58241 79 .global pDivRom_uidiv // pointer to the romdivide 'uidiv' function
mbed_official 232:1e593fe58241 80 .func
mbed_official 232:1e593fe58241 81 .thumb_func
mbed_official 232:1e593fe58241 82 .type __aeabi_uidiv, %function
mbed_official 232:1e593fe58241 83
mbed_official 232:1e593fe58241 84 __aeabi_uidiv:
mbed_official 232:1e593fe58241 85 push {r4, lr}
mbed_official 232:1e593fe58241 86 ldr r3, =pDivRom_uidiv
mbed_official 232:1e593fe58241 87 ldr r3, [r3, #0] // Load address of function
mbed_official 232:1e593fe58241 88 blx r3 // Call divide function
mbed_official 232:1e593fe58241 89 pop {r4, pc}
mbed_official 232:1e593fe58241 90
mbed_official 232:1e593fe58241 91 .endfunc
mbed_official 232:1e593fe58241 92
mbed_official 232:1e593fe58241 93 #endif // (__USE_ROMDIVIDE)