repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
kernel debug: priv can be NULL early on
[minix.git]
/
lib
/
libminlib
/
u64util.c
blob
bcddb067f10cbc8999037541ce941d8341dc6a8b
1
/* Few u64 utils implemented in C
2
* Author: Gautam BT
3
*/
4
#include <minix/u64.h>
5
6
u64_t
rrotate64
(
u64_t x
,
unsigned short
b
)
7
{
8
b
%=
64
;
9
if
((
b
&=
63
) ==
0
)
10
return
x
;
11
return
(
x
>>
b
) | (
x
<< (
64
-
b
));
12
}
13
14
u64_t
rshift64
(
u64_t x
,
unsigned short
b
)
15
{
16
if
(
b
>=
64
)
17
return
0
;
18
return
x
>>
b
;
19
}
20
21
u64_t
xor64
(
u64_t a
,
u64_t b
)
22
{
23
return
a
^
b
;
24
}
25
26
u64_t
and64
(
u64_t a
,
u64_t b
)
27
{
28
return
a
&
b
;
29
}
30
31
u64_t
not64
(
u64_t a
)
32
{
33
return
~
a
;
34
}