summaryrefslogtreecommitdiffstats
path: root/userspace/ncrypto_fd.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-09 20:05:22 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-23 20:02:00 +0200
commit7687d57b337a16e82d0e70725a83c0e612d16f93 (patch)
tree85624a4b40d50d3eba7a9ca4b26b5f567c4ef334 /userspace/ncrypto_fd.c
parentaac00a3bf423f77344f62d129ef0050fea711756 (diff)
downloadcryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.tar.gz
cryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.tar.xz
cryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.zip
Avoid unnecessary internal relocations
Use __attribute__((visibility("hidden"))) for __ncr_file_descriptor to take advantage of PIC addressing instead of going through the dynamic linker. Add an internal alias for ncr_global_init() for the same reason. Add an internal header file to consolidate the "extern" references in the process.
Diffstat (limited to 'userspace/ncrypto_fd.c')
-rw-r--r--userspace/ncrypto_fd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/userspace/ncrypto_fd.c b/userspace/ncrypto_fd.c
index 7e6741d..f4dee3e 100644
--- a/userspace/ncrypto_fd.c
+++ b/userspace/ncrypto_fd.c
@@ -5,13 +5,14 @@
#include <unistd.h>
#include <linux/ncr.h>
#include "ncrypto.h"
+#include "ncrypto_internal.h"
int __ncr_file_descriptor = -1;
static int open_count = 0;
static pthread_mutex_t open_lock = PTHREAD_MUTEX_INITIALIZER;
int
-ncr_global_init(unsigned int flags)
+__ncr_global_init()
{
int rv = 0;
@@ -25,6 +26,12 @@ ncr_global_init(unsigned int flags)
return rv;
}
+int
+ncr_global_init(unsigned int flags)
+{
+ return __ncr_global_init();
+}
+
void
ncr_global_deinit(void)
{