Lines Matching refs:optee
21 static bool have_key(struct optee *optee, u_int key)
25 list_for_each_entry(entry, &optee->notif.db, link)
32 int optee_notif_wait(struct optee *optee, u_int key)
38 if (key > optee->notif.max_key)
47 spin_lock_irqsave(&optee->notif.lock, flags);
53 if (test_bit(key, optee->notif.bitmap)) {
54 clear_bit(key, optee->notif.bitmap);
62 if (have_key(optee, key)) {
67 list_add_tail(&entry->link, &optee->notif.db);
72 spin_unlock_irqrestore(&optee->notif.lock, flags);
74 spin_lock_irqsave(&optee->notif.lock, flags);
78 spin_unlock_irqrestore(&optee->notif.lock, flags);
85 int optee_notif_send(struct optee *optee, u_int key)
90 if (key > optee->notif.max_key)
93 spin_lock_irqsave(&optee->notif.lock, flags);
95 list_for_each_entry(entry, &optee->notif.db, link)
102 set_bit(key, optee->notif.bitmap);
104 spin_unlock_irqrestore(&optee->notif.lock, flags);
109 int optee_notif_init(struct optee *optee, u_int max_key)
111 spin_lock_init(&optee->notif.lock);
112 INIT_LIST_HEAD(&optee->notif.db);
113 optee->notif.bitmap = bitmap_zalloc(max_key, GFP_KERNEL);
114 if (!optee->notif.bitmap)
117 optee->notif.max_key = max_key;
122 void optee_notif_uninit(struct optee *optee)
124 bitmap_free(optee->notif.bitmap);