Lines Matching defs:area
2 * IPC SHM area manager
60 * \brief Create a shm area record
62 * \param ptr the shared area pointer
63 * \return The allocated shm area record, NULL if fail
65 * Allocates a shared area record with the given SHM ID and pointer.
70 struct snd_shm_area *area = malloc(sizeof(*area));
71 if (area) {
72 area->shmid = shmid;
73 area->ptr = ptr;
74 area->share = 1;
75 list_add_tail(&area->list, &shm_areas);
77 return area;
81 * \brief Increase the reference counter of shm area record
82 * \param area shm area record
83 * \return the shm area record (identical with the argument)
85 * Increases the reference counter of the given shared area record.
87 struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area)
89 if (area == NULL)
91 area->share++;
92 return area;
96 * \brief Release the shared area record
97 * \param area the shared are record
100 * Decreases the reference counter of the given shared area record, and
103 int snd_shm_area_destroy(struct snd_shm_area *area)
105 if (area == NULL)
107 if (--area->share)
109 list_del(&area->list);
110 shmdt(area->ptr);
111 free(area);
121 struct snd_shm_area *area;
124 area = list_entry(pos, struct snd_shm_area, list);
125 shmdt(area->ptr);