Changeset 4872160 in mainline for boot/genarch/include/division.h
- Timestamp:
- 2010-05-04T10:44:55Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 568db0f
- Parents:
- bb252ca
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/genarch/include/division.h
rbb252ca r4872160 1 1 /* 2 * Copyright (c) 2007 Michal Kebrt 3 * Copyright (c) 2009 Vineeth Pillai 2 * Copyright (c) 2006 Josef Cejka 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 29 /** @file 30 */ 30 31 31 /** @addtogroup arm32boot 32 * @{ 33 */ 34 /** @file 35 * @brief bootloader output logic 36 */ 32 #ifndef BOOT_DIVISION_H_ 33 #define BOOT_DIVISION_H_ 37 34 35 /* 32bit integer division */ 36 extern int __divsi3(int, int); 38 37 39 #include <printf.h> 38 /* 64bit integer division */ 39 extern long long __divdi3(long long, long long); 40 40 41 /* 32bit unsigned integer division */ 42 extern unsigned int __udivsi3(unsigned int, unsigned int); 41 43 42 /** Address where characters to be printed are expected. */ 43 #ifdef MACHINE_testarm 44 #define PUTC_ADDRESS 0x10000000 44 /* 64bit unsigned integer division */ 45 extern unsigned long long __udivdi3(unsigned long long, unsigned long long); 46 47 /* 32bit remainder of the signed division */ 48 extern int __modsi3(int, int); 49 50 /* 64bit remainder of the signed division */ 51 extern long long __moddi3(long long, long long); 52 53 /* 32bit remainder of the unsigned division */ 54 extern unsigned int __umodsi3(unsigned int, unsigned int); 55 56 /* 64bit remainder of the unsigned division */ 57 extern unsigned long long __umoddi3(unsigned long long, unsigned long long); 58 59 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long, 60 unsigned long long *); 61 45 62 #endif 46 47 #ifdef MACHINE_integratorcp48 #define PUTC_ADDRESS 0x1600000049 #endif50 51 52 53 /** Prints a character to the console.54 *55 * @param ch Character to be printed.56 */57 static void putc(char ch)58 {59 if (ch == '\n')60 *((volatile char *) PUTC_ADDRESS) = '\r';61 *((volatile char *) PUTC_ADDRESS) = ch;62 }63 64 65 /** Prints a string to the console.66 *67 * @param str String to be printed.68 * @param len Number of characters to be printed.69 */70 void write(const char *str, const int len)71 {72 int i;73 for (i = 0; i < len; ++i) {74 putc(str[i]);75 }76 }77 63 78 64 /** @} 79 65 */ 80
Note:
See TracChangeset
for help on using the changeset viewer.