mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Add a common header file for libgcc functions
git-svn-id: svn://coreboot.org/openbios/openbios-devel@192 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -2,10 +2,7 @@
|
||||
* arch/i386/libgcc/__divdi3.c
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
int64_t __divdi3(int64_t num, int64_t den)
|
||||
{
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
* arch/i386/libgcc/__divti3.c
|
||||
*/
|
||||
|
||||
#include "asm/types.h"
|
||||
#define NULL ((void *)0)
|
||||
|
||||
extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
__int128_t __divti3(__int128_t num, __int128_t den)
|
||||
{
|
||||
|
||||
@@ -18,12 +18,9 @@ along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
#include "libgcc.h"
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
* arch/i386/libgcc/__divdi3.c
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
uint64_t __udivdi3(uint64_t num, uint64_t den)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include <stdint.h>
|
||||
|
||||
extern void __divide_error();
|
||||
#include "libgcc.h"
|
||||
|
||||
uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include "asm/types.h"
|
||||
|
||||
extern void __divide_error();
|
||||
#include "libgcc.h"
|
||||
|
||||
__uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem_p)
|
||||
{
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
* arch/i386/libgcc/__divdi3.c
|
||||
*/
|
||||
|
||||
#include "asm/types.h"
|
||||
#define NULL ((void *)0)
|
||||
|
||||
extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
__uint128_t __udivti3(__uint128_t num, __uint128_t den)
|
||||
{
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
* arch/i386/libgcc/__umoddi3.c
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
uint64_t __umoddi3(uint64_t num, uint64_t den)
|
||||
{
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
* arch/i386/libgcc/__umoddi3.c
|
||||
*/
|
||||
|
||||
#include "asm/types.h"
|
||||
|
||||
extern __uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem);
|
||||
#include "libgcc.h"
|
||||
|
||||
__uint128_t __umodti3(__uint128_t num, __uint128_t den)
|
||||
{
|
||||
|
||||
@@ -18,12 +18,9 @@ along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
#include "libgcc.h"
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
|
||||
@@ -18,12 +18,9 @@ along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
#include "libgcc.h"
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
|
||||
37
libgcc/libgcc.h
Normal file
37
libgcc/libgcc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _LIBGCC_H
|
||||
#define _LIBGCC_H
|
||||
|
||||
#include "asm/types.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
typedef int TItype __attribute__ ((mode (TI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
|
||||
__uint128_t __udivmodti4(__uint128_t num, __uint128_t den, __uint128_t *rem);
|
||||
|
||||
int64_t __divdi3(int64_t num, int64_t den);
|
||||
uint64_t __udivdi3(uint64_t num, uint64_t den);
|
||||
__int128_t __divti3(__int128_t num, __int128_t den);
|
||||
__uint128_t __udivti3(__uint128_t num, __uint128_t den);
|
||||
|
||||
uint64_t __umoddi3(uint64_t num, uint64_t den);
|
||||
__uint128_t __umodti3(__uint128_t num, __uint128_t den);
|
||||
|
||||
DItype __ashldi3 (DItype u, word_type b);
|
||||
DItype __lshrdi3 (DItype u, word_type b);
|
||||
DItype __ashrdi3 (DItype u, word_type b);
|
||||
|
||||
TItype __multi3 (TItype u, TItype v);
|
||||
|
||||
// Must be implemented outside:
|
||||
void __divide_error(void);
|
||||
|
||||
#endif /* _LIBGCC_H */
|
||||
@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "libgcc.h"
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
#define DI_TYPE_SIZE 64
|
||||
|
||||
@@ -56,11 +58,6 @@ Boston, MA 02111-1307, USA. */
|
||||
umul_ppmm (__w.s.high, __w.s.low, u, v); \
|
||||
__w.ll; })
|
||||
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
typedef int TItype __attribute__ ((mode (TI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
struct TIstruct {DItype high, low;};
|
||||
|
||||
typedef union
|
||||
|
||||
Reference in New Issue
Block a user