Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FPGA Configuration Space
Commits
008c2416
Commit
008c2416
authored
13 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
simulation: use BE conversions defining htonll
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a74c7b61
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
simulation/fw/wb_cfggen.c
+1
-1
1 addition, 1 deletion
simulation/fw/wb_cfggen.c
simulation/include/linux/sdwb.h
+31
-5
31 additions, 5 deletions
simulation/include/linux/sdwb.h
with
32 additions
and
6 deletions
simulation/fw/wb_cfggen.c
+
1
−
1
View file @
008c2416
...
...
@@ -74,7 +74,7 @@ struct sdwb_wbid *sdwb_create_id()
if
(
!
id
)
return
NULL
;
id
->
bstream_type
=
hto
be64
(
0xdeadbeefdeadbeef
);
id
->
bstream_type
=
hto
nll
(
0xdeadbeefdeadbeef
LL
);
return
id
;
}
...
...
This diff is collapsed.
Click to expand it.
simulation/include/linux/sdwb.h
+
31
−
5
View file @
008c2416
...
...
@@ -23,13 +23,39 @@
#ifndef _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 */
#define SDWB_HEAD_MAGIC 0x5344574248454144LL
/* The following comes from arch/um/drivers/cow.h -- factorazing anyone? */
#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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment