Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 25a76ab8 in mainline for boot/genarch/include/division.h


Ignore:
Timestamp:
2010-05-08T07:53:23Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
051bc69a
Parents:
6c39a907 (diff), 1317380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • boot/genarch/include/division.h

    r6c39a907 r25a76ab8  
    11/*
    2  * Copyright (c) 2007 Michal Kebrt
    3  * Copyright (c) 2009 Vineeth Pillai
     2 * Copyright (c) 2006 Josef Cejka
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
     29/** @file
     30 */
    3031
    31 /** @addtogroup arm32boot
    32  * @{
    33  */
    34 /** @file
    35  *  @brief bootloader output logic
    36  */
     32#ifndef BOOT_DIVISION_H_
     33#define BOOT_DIVISION_H_
    3734
     35/* 32bit integer division */
     36extern int __divsi3(int, int);
    3837
    39 #include <printf.h>
     38/* 64bit integer division */
     39extern long long __divdi3(long long, long long);
    4040
     41/* 32bit unsigned integer division */
     42extern unsigned int __udivsi3(unsigned int, unsigned int);
    4143
    42 /** Address where characters to be printed are expected. */
    43 #ifdef MACHINE_testarm
    44         #define PUTC_ADDRESS  0x10000000
     44/* 64bit unsigned integer division */
     45extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
     46
     47/* 32bit remainder of the signed division */
     48extern int __modsi3(int, int);
     49
     50/* 64bit remainder of the signed division */
     51extern long long __moddi3(long long, long long);
     52
     53/* 32bit remainder of the unsigned division */
     54extern unsigned int __umodsi3(unsigned int, unsigned int);
     55
     56/* 64bit remainder of the unsigned division */
     57extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
     58
     59extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
     60    unsigned long long *);
     61
    4562#endif
    46 
    47 #ifdef MACHINE_integratorcp
    48         #define PUTC_ADDRESS  0x16000000
    49 #endif
    50 
    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 }
    7763
    7864/** @}
    7965 */
    80 
Note: See TracChangeset for help on using the changeset viewer.