2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A#include "kernelGlobal.h"
2N/A#include "kernelSession.h"
2N/A#include "kernelSlot.h"
2N/A/* protects kernel_initialized and entrance to C_Initialize/Finalize */
2N/Astatic void finalize_common(void);
2N/Astatic void cleanup_library(void);
2N/Astatic void kernel_init(void);
2N/Astatic void kernel_fini(void);
2N/Astatic void kernel_fork_prepare(void);
2N/Astatic void kernel_fork_after(void);
2N/A if (kernel_initialized) {
2N/A return (CKR_CRYPTOKI_ALREADY_INITIALIZED);
2N/A return (CKR_ARGUMENTS_BAD);
2N/A if (!supplied_ok) {
2N/A return (CKR_ARGUMENTS_BAD);
2N/A return (CKR_CANT_LOCK);
2N/A return (CKR_FUNCTION_FAILED);
2N/A return (CKR_HOST_MEMORY);
2N/A if (!kernel_initialized) {
2N/A return (CKR_CRYPTOKI_NOT_INITIALIZED);
2N/A return (CKR_ARGUMENTS_BAD);
2N/A for (i = 0; i < slot_count; i++) {
2N/A if (slot_count > 0) {
2N/A for (i = 0; i < slot_count; i++) {
2N/A slot_count = 0;
2N/A for (i = 0; i < KMECH_HASHTABLE_SIZE; i++) {
2N/A kernel_pid = 0;
2N/A for (i = 0; i < slot_count; i++) {
2N/A if (!kernel_initialized) {
2N/A if (!kernel_initialized)
2N/A return (CKR_CRYPTOKI_NOT_INITIALIZED);
2N/A return (CKR_ARGUMENTS_BAD);
2N/A return (CKR_ARGUMENTS_BAD);
2N/A return (CKR_FUNCTION_NOT_PARALLEL);
2N/A * 4. ses_delay_freed.ses_to_be_free_mutex
2N/A if (kernel_initialized) {
2N/A (void) pthread_mutex_lock(
2N/A (void) pthread_mutex_lock(
2N/A if (kernel_initialized) {
2N/A (void) pthread_mutex_unlock(
2N/A (void) pthread_mutex_unlock(
2N/A return (CKR_FUNCTION_NOT_PARALLEL);