Lines Matching defs:emad
192 * spmc_shmem_obj_get_emad - Get the emad from a given index depending on the
195 * @index: The index of the emad element to be accessed.
197 * @emad_size: Will be populated with the size of the returned emad
199 * Return: A pointer to the requested emad structure.
205 uint8_t *emad;
214 emad = (uint8_t *)desc + offsetof(struct ffa_mtd_v1_0, emad);
218 emad = ((uint8_t *) desc + desc->emad_offset);
223 return (emad + (*emad_size * index));
239 * The comp_mrd_offset field of the emad descriptor remains consistent
243 struct ffa_emad_v1_0 *emad = spmc_shmem_obj_get_emad(&obj->desc, 0,
248 if (!is_aligned(emad->comp_mrd_offset, 8)) {
254 ((uint8_t *)(&obj->desc) + emad->comp_mrd_offset);
274 struct ffa_emad_v1_0 *emad;
276 emad = spmc_shmem_obj_get_emad(desc, i,
280 * Validate the calculated emad address resides within the
283 if ((emad == NULL) || (uintptr_t) emad >=
285 VERBOSE("Invalid emad.\n");
288 if (sp_id == emad->mapd.endpoint_id) {
367 struct ffa_emad_v1_0 *emad_array = orig->emad;
372 /* Add the size of the emad descriptors. */
408 /* Add the size of the v1.0 emad descriptors. */
460 * We will locate the emad descriptors directly after the ffa_mtd
465 emad_array_in = mtd_orig->emad;
469 /* Copy across the emad structs. */
471 /* Bound check for emad array. */
481 /* Place the mrd descriptors after the end of the emad descriptors.*/
554 /* Determine the location of the emad array in both descriptors. */
557 emad_array_out = out->emad;
559 /* Copy across the emad structs. */
562 /* Bound check for emad array. */
574 /* Place the mrd descriptors after the end of the emad descriptors. */
577 mrd_out_offset = (uint8_t *) out->emad - (uint8_t *) out +
731 WARN("%s: Bad emad size (%" PRIu32 " < %zu).\n", __func__,
766 emad_advance(const struct ffa_emad_v1_0 *emad, size_t offset)
768 return (const struct ffa_emad_v1_0 *)((const uint8_t *)emad + offset);
812 for (const struct ffa_emad_v1_0 *emad = first_emad; emad < end_emad;) {
821 ep_id = emad->mapd.endpoint_id;
834 if (comp_mrd_offset != emad->comp_mrd_offset) {
836 __func__, emad->comp_mrd_offset, comp_mrd_offset);
841 emad = emad_advance(emad, emad_size);
844 * Ensure neither this emad nor any subsequent emads have
845 * the same partition ID as the previous emad.
847 for (const struct ffa_emad_v1_0 *other_emad = emad;
852 __func__, emad->mapd.endpoint_id);
866 WARN("%s: invalid object, offset %u < header + emad %zu\n",
1539 /* Validate that the provided emad offset and structure is valid.*/
1542 struct ffa_emad_v1_0 *emad;
1544 emad = spmc_shmem_obj_get_emad(req, i, ffa_version,
1547 if ((uintptr_t) emad >= (uintptr_t)
1549 WARN("Invalid emad access.\n");
1564 struct ffa_emad_v1_0 *emad;
1567 emad = spmc_shmem_obj_get_emad(req, i, ffa_version,
1576 emad->mapd.endpoint_id ==
1585 __func__, emad->mapd.endpoint_id);