Back to home page

LXR

 
 

    


0001 /*
0002  * Workqueue for crypto subsystem
0003  *
0004  * Copyright (c) 2009 Intel Corp.
0005  *   Author: Huang Ying <ying.huang@intel.com>
0006  *
0007  * This program is free software; you can redistribute it and/or modify it
0008  * under the terms of the GNU General Public License as published by the Free
0009  * Software Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  */
0013 
0014 #include <linux/workqueue.h>
0015 #include <linux/module.h>
0016 #include <crypto/algapi.h>
0017 #include <crypto/crypto_wq.h>
0018 
0019 struct workqueue_struct *kcrypto_wq;
0020 EXPORT_SYMBOL_GPL(kcrypto_wq);
0021 
0022 static int __init crypto_wq_init(void)
0023 {
0024     kcrypto_wq = alloc_workqueue("crypto",
0025                      WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1);
0026     if (unlikely(!kcrypto_wq))
0027         return -ENOMEM;
0028     return 0;
0029 }
0030 
0031 static void __exit crypto_wq_exit(void)
0032 {
0033     destroy_workqueue(kcrypto_wq);
0034 }
0035 
0036 subsys_initcall(crypto_wq_init);
0037 module_exit(crypto_wq_exit);
0038 
0039 MODULE_LICENSE("GPL");
0040 MODULE_DESCRIPTION("Workqueue for crypto subsystem");