Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitry Baryshkov
nettle
Commits
27a3ddf6
Commit
27a3ddf6
authored
Jan 20, 2015
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Implemented handling of NETTLE_FAT_OVERRIDE, for arm.
parent
ce5c66d7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+3
-0
3 additions, 0 deletions
ChangeLog
fat-arm.c
+70
-42
70 additions, 42 deletions
fat-arm.c
with
73 additions
and
42 deletions
ChangeLog
+
3
−
0
View file @
27a3ddf6
2015-01-20 Niels Möller <nisse@lysator.liu.se>
* fat-arm.c (get_arm_features): Check NETTLE_FAT_OVERRIDE
environment variable.
* fat-x86_64.c (get_x86_features): New function. Check
NETTLE_FAT_OVERRIDE environment variable.
(fat_init): Use it.
...
...
This diff is collapsed.
Click to expand it.
fat-arm.c
+
70
−
42
View file @
27a3ddf6
...
...
@@ -52,17 +52,44 @@ struct arm_features
int
have_neon
;
};
#define SKIP(s, slen, literal, llen) \
(((slen) >= (llen) && memcmp ((s), (literal), llen) == 0) \
? ((slen) -= (llen), (s) += (llen), 1) : 0)
#define MATCH(s, slen, literal, llen) \
((slen) == (llen) && memcmp ((s), (literal), llen) == 0)
static
void
get_arm_features
(
struct
arm_features
*
features
)
{
const
char
*
s
;
features
->
arch_version
=
5
;
features
->
have_neon
=
0
;
s
=
secure_getenv
(
ENV_OVERRIDE
);
if
(
s
)
for
(;;)
{
const
char
*
sep
=
strchr
(
s
,
','
);
size_t
length
=
sep
?
(
size_t
)
(
sep
-
s
)
:
strlen
(
s
);
if
(
SKIP
(
s
,
length
,
"arch:"
,
5
))
{
if
(
length
==
1
&&
*
s
>=
'0'
&&
*
s
<=
'9'
)
features
->
arch_version
=
*
s
-
'0'
;
}
else
if
(
MATCH
(
s
,
length
,
"neon"
,
4
))
features
->
have_neon
=
1
;
if
(
!
sep
)
break
;
s
=
sep
+
1
;
}
else
{
FILE
*
f
;
char
line
[
200
];
int
seen_arch
=
0
;
int
seen_features
=
0
;
features
->
arch_version
=
5
;
features
->
have_neon
=
0
;
f
=
fopen
(
"/proc/cpuinfo"
,
"r"
);
if
(
!
f
)
return
;
...
...
@@ -104,6 +131,7 @@ get_arm_features (struct arm_features *features)
}
fclose
(
f
);
}
}
DECLARE_FAT_FUNC
(
_nettle_aes_encrypt
,
aes_crypt_internal_func
)
DECLARE_FAT_FUNC_VAR
(
aes_encrypt
,
aes_crypt_internal_func
,
arm
)
...
...
@@ -127,9 +155,9 @@ fat_init (void)
verbose
=
getenv
(
ENV_VERBOSE
)
!=
NULL
;
if
(
verbose
)
fprintf
(
stderr
,
"libnettle: cpu arch: %u, neon: %s
\n
"
,
features
.
arch_version
,
features
.
have_neon
?
"
yes
"
:
"
no
"
);
fprintf
(
stderr
,
"libnettle: cpu features: arch:%d%s
\n
"
,
features
.
arch_version
,
features
.
have_neon
?
"
,neon
"
:
""
);
if
(
features
.
arch_version
>=
6
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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