Lines Matching full:optee
21 static bool have_key(struct optee *optee, u_int key) in have_key() argument
25 list_for_each_entry(entry, &optee->notif.db, link) in have_key()
32 int optee_notif_wait(struct optee *optee, u_int key, u32 timeout) in optee_notif_wait() argument
38 if (key > optee->notif.max_key) in optee_notif_wait()
47 spin_lock_irqsave(&optee->notif.lock, flags); in optee_notif_wait()
53 if (test_bit(key, optee->notif.bitmap)) { in optee_notif_wait()
54 clear_bit(key, optee->notif.bitmap); in optee_notif_wait()
62 if (have_key(optee, key)) { in optee_notif_wait()
67 list_add_tail(&entry->link, &optee->notif.db); in optee_notif_wait()
72 spin_unlock_irqrestore(&optee->notif.lock, flags); in optee_notif_wait()
79 spin_lock_irqsave(&optee->notif.lock, flags); in optee_notif_wait()
83 spin_unlock_irqrestore(&optee->notif.lock, flags); in optee_notif_wait()
90 int optee_notif_send(struct optee *optee, u_int key) in optee_notif_send() argument
95 if (key > optee->notif.max_key) in optee_notif_send()
98 spin_lock_irqsave(&optee->notif.lock, flags); in optee_notif_send()
100 list_for_each_entry(entry, &optee->notif.db, link) in optee_notif_send()
107 set_bit(key, optee->notif.bitmap); in optee_notif_send()
109 spin_unlock_irqrestore(&optee->notif.lock, flags); in optee_notif_send()
114 int optee_notif_init(struct optee *optee, u_int max_key) in optee_notif_init() argument
116 spin_lock_init(&optee->notif.lock); in optee_notif_init()
117 INIT_LIST_HEAD(&optee->notif.db); in optee_notif_init()
118 optee->notif.bitmap = bitmap_zalloc(max_key, GFP_KERNEL); in optee_notif_init()
119 if (!optee->notif.bitmap) in optee_notif_init()
122 optee->notif.max_key = max_key; in optee_notif_init()
127 void optee_notif_uninit(struct optee *optee) in optee_notif_uninit() argument
129 bitmap_free(optee->notif.bitmap); in optee_notif_uninit()