Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FPGA Configuration Space
Commits
008c2416
Commit
008c2416
authored
Nov 08, 2011
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simulation: use BE conversions defining htonll
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a74c7b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
wb_cfggen.c
simulation/fw/wb_cfggen.c
+1
-1
sdwb.h
simulation/include/linux/sdwb.h
+31
-5
No files found.
simulation/fw/wb_cfggen.c
View file @
008c2416
...
@@ -74,7 +74,7 @@ struct sdwb_wbid *sdwb_create_id()
...
@@ -74,7 +74,7 @@ struct sdwb_wbid *sdwb_create_id()
if
(
!
id
)
if
(
!
id
)
return
NULL
;
return
NULL
;
id
->
bstream_type
=
hto
be64
(
0xdeadbeefdeadbeef
);
id
->
bstream_type
=
hto
nll
(
0xdeadbeefdeadbeefLL
);
return
id
;
return
id
;
}
}
...
...
simulation/include/linux/sdwb.h
View file @
008c2416
...
@@ -23,13 +23,39 @@
...
@@ -23,13 +23,39 @@
#ifndef _SDWB_H
#ifndef _SDWB_H
#define _SDWB_H
#define _SDWB_H
/* SDWB magic numbers */
/*
* SDWB magic numbers. They are all big-endian. We use be**_to_cpu in
* kernel space, and network order in user space. Please note that
* we define the internal values as constants, but help users by
* also defining the host-order values (without leading underscores)
*/
#define __SDWB_HEAD_MAGIC 0x5344574248454144LL
/* "SDWBHEAD" */
#define __SDWB_WBD_MAGIC 0x5742
/* "WB" */
#define SDWB_HEAD_MAGIC ntohll(__SDWB_HEAD_MAGIC)
#define SDWB_WBD_MAGIC ntohs(__SDWB_WBD_MAGIC)
/* 'SDWBHEAD' (big endian). Used in SDWB Header */
/* The following comes from arch/um/drivers/cow.h -- factorazing anyone? */
#define SDWB_HEAD_MAGIC 0x5344574248454144LL
#if !defined(ntohll) && defined(__KERNEL__)
# include <asm/byteorder.h>
# define ntohll(x) be64_to_cpu(x)
# define htonll(x) cpu_to_be64(x)
#elif !defined(ntohll) && !defined(__KERNEL__)
# include <endian.h>
# include <netinet/in.h>
# if defined(__BYTE_ORDER)
# if __BYTE_ORDER == __BIG_ENDIAN
# define ntohll(x) (x)
# define htonll(x) (x)
# else
# define ntohll(x) __bswap_64(x)
# define htonll(x) __bswap_64(x)
# endif
# else
# error "Could not determine byte order: __BYTE_ORDER undefined"
# endif
#endif
/* __KERNEL__ */
/* 'WB' (big endian, 16 bits). Used in SDWB device descriptors */
#define SDWB_WBD_MAGIC 0x5742
/*
/*
* SDWB - Header structure
* SDWB - Header structure
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment