mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 08:39:28 +00:00
update the network support to etherboot-4.5.8.
This commit is contained in:
1 parent
26fef18cb8
commit
5ff25f9b8f
51 files changed
+5395
-3479
No files matched your search
+29
-21
@@ -1,4 +1,4 @@
|
||||
#ifndef __OSDEP_H__
|
||||
#ifndef __OSDEP_H__
|
||||
#define __OSDEP_H__
|
||||
|
||||
/*
|
||||
@@ -8,30 +8,39 @@
|
||||
* your option) any later version.
|
||||
*/
|
||||
|
||||
#if 1
|
||||
# define ETHERBOOT32
|
||||
# include <byteorder.h>
|
||||
# if 0
|
||||
# include <linux-asm-string.h>
|
||||
# endif
|
||||
# include <linux-asm-io.h>
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(GRUB)
|
||||
#define ETHERBOOT32
|
||||
#include <asm/byteorder.h>
|
||||
#include "linux-asm-string.h"
|
||||
#include "linux-asm-io.h"
|
||||
#define _edata edata /* ELF does not prepend a _ */
|
||||
#define _end end
|
||||
#endif
|
||||
#define ntohl(x) swap32(x)
|
||||
#define htonl(x) swap32(x)
|
||||
#define ntohs(x) swap16(x)
|
||||
#define htons(x) swap16(x)
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define ETHERBOOT32
|
||||
#include <sys/types.h>
|
||||
#include "linux-asm-string.h"
|
||||
static inline unsigned long int swap32(unsigned long int x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0\n\t"
|
||||
"rorl $16,%0\n\t"
|
||||
"xchgb %b0,%h0"
|
||||
: "=q" (x)
|
||||
: "0" (x));
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline unsigned short int swap16(unsigned short int x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0"
|
||||
: "=q" (x)
|
||||
: "0" (x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#ifndef GRUB
|
||||
# include "linux-asm-string.h"
|
||||
#endif /* ! GRUB */
|
||||
#include "linux-asm-io.h"
|
||||
#ifndef GRUB
|
||||
#define _edata edata /* ELF does not prepend a _ */
|
||||
#define _end end
|
||||
#endif /* ! GRUB */
|
||||
#endif
|
||||
|
||||
#ifdef __BCC__
|
||||
@@ -48,7 +57,6 @@ typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(ETHERBOOT16) && !defined(ETHERBOOT32)
|
||||
Error, neither ETHERBOOT16 nor ETHERBOOT32 defined
|
||||
|
||||
Reference in new issue
Block a user