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

Changeset c7afcba7 in mainline


Ignore:
Timestamp:
2012-04-07T17:50:49Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
446ac2a
Parents:
8e893ae
Message:

unification and cstyle

Files:
6 edited

Legend:

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

    r8e893ae rc7afcba7  
    4545extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
    4646
     47extern int __divmodsi3(int, int, int *);
    4748extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
     49
     50extern long long __divmoddi3(long long, long long, long long *);
    4851extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
    4952    unsigned long long *);
  • boot/genarch/src/division.c

    r8e893ae rc7afcba7  
    183183}
    184184
     185int __divmodsi3(int a, int b, int *c)
     186{
     187        unsigned int rem;
     188        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     189       
     190        if (SGN(a) == SGN(b)) {
     191                *c = rem;
     192                return result;
     193        }
     194       
     195        *c = -rem;
     196        return -result;
     197}
     198
    185199unsigned int __udivmodsi3(unsigned int a, unsigned int b,
    186200    unsigned int *c)
     
    189203}
    190204
     205long long __divmoddi3(long long a, long long b, long long *c)
     206{
     207        unsigned long long rem;
     208        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     209       
     210        if (SGN(a) == SGN(b)) {
     211                *c = rem;
     212                return result;
     213        }
     214       
     215        *c = -rem;
     216        return -result;
     217}
     218
    191219unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    192220    unsigned long long *c)
  • kernel/genarch/include/softint/division.h

    r8e893ae rc7afcba7  
    4848extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
    4949
     50extern int __divmodsi3(int, int, int *);
    5051extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
     52
     53extern long long __divmoddi3(long long, long long, long long *);
    5154extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
    5255    unsigned long long *);
  • kernel/genarch/include/softint/multiplication.h

    r8e893ae rc7afcba7  
    2929/** @addtogroup genarch
    3030 * @{
    31  */ 
     31 */
    3232/**
    3333 * @file
    3434 */
    3535
    36 #ifndef __SOFTINT_MULTIPLICATION_H__
    37 #define __SOFTINT_MULTIPLICATION_H__
     36#ifndef KERN_MULTIPLICATION_H_
     37#define KERN_MULTIPLICATION_H_
    3838
    3939/* 64 bit multiplication */
    40 long long __muldi3(long long a, long long b);
     40extern long long __muldi3(long long, long long);
    4141
    4242#endif
     
    4444/** @}
    4545 */
    46 
    47 
  • kernel/genarch/src/softint/division.c

    r8e893ae rc7afcba7  
    2727 */
    2828
    29 /** @addtogroup genarch 
     29/** @addtogroup genarch
    3030 * @{
    3131 */
     
    186186}
    187187
     188int __divmodsi3(int a, int b, int *c)
     189{
     190        unsigned int rem;
     191        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     192       
     193        if (SGN(a) == SGN(b)) {
     194                *c = rem;
     195                return result;
     196        }
     197       
     198        *c = -rem;
     199        return -result;
     200}
     201
    188202unsigned int __udivmodsi3(unsigned int a, unsigned int b,
    189203    unsigned int *c)
     
    192206}
    193207
     208long long __divmoddi3(long long a, long long b, long long *c)
     209{
     210        unsigned long long rem;
     211        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     212       
     213        if (SGN(a) == SGN(b)) {
     214                *c = rem;
     215                return result;
     216        }
     217       
     218        *c = -rem;
     219        return -result;
     220}
     221
    194222unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    195223    unsigned long long *c)
  • kernel/genarch/src/softint/multiplication.c

    r8e893ae rc7afcba7  
    2929/** @addtogroup genarch
    3030 * @{
    31  */ 
     31 */
    3232/**
    3333 * @file
     
    130130
    131131        return result;
    132 }       
     132}
    133133
    134134/** @}
Note: See TracChangeset for help on using the changeset viewer.