return grp->length;
}
-u32 acpi_fill_csrt(u32 current)
+int acpi_fill_csrt(struct acpi_ctx *ctx)
{
- current += acpi_fill_csrt_dma((struct acpi_csrt_group *)current);
+ int size;
- return current;
+ size = acpi_fill_csrt_dma(ctx->current);
+ acpi_inc(ctx, size);
+
+ return 0;
}
int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
u16 seg_nr, u8 start, u8 end);
u32 acpi_fill_mcfg(u32 current);
-u32 acpi_fill_csrt(u32 current);
/**
* acpi_write_hpet() - Write out a HPET table
*/
void acpi_fill_header(struct acpi_table_header *header, char *signature);
+/**
+ * acpi_fill_csrt() - Fill out the body of the CSRT
+ *
+ * This should write the contents of the Core System Resource Table (CSRT)
+ * to the context. The header (struct acpi_table_header) has already been
+ * written.
+ *
+ * @ctx: ACPI context to write to
+ * @return 0 if OK, -ve on error
+ */
+int acpi_fill_csrt(struct acpi_ctx *ctx);
+
#endif /* !__ACPI__*/
#include <asm/acpi_table.h>
#include <acpi/acpi_table.h>
#include <dm/acpi.h>
-__weak u32 acpi_fill_csrt(u32 current)
+__weak int acpi_fill_csrt(struct acpi_ctx *ctx)
{
return 0;
}
{
struct acpi_table_header *header;
struct acpi_csrt *csrt;
- uint ptr;
+ int ret;
csrt = ctx->current;
header = &csrt->header;
/* Fill out header fields */
acpi_fill_header(header, "CSRT");
- header->length = sizeof(struct acpi_csrt);
header->revision = 0;
+ acpi_inc(ctx, sizeof(*header));
- ptr = acpi_fill_csrt(map_to_sysmem(csrt));
- if (!ptr)
- return log_msg_ret("fill", -ENOENT);
+ ret = acpi_fill_csrt(ctx);
+ if (ret)
+ return log_msg_ret("fill", ret);
/* (Re)calculate length and checksum */
header->length = (ulong)ctx->current - (ulong)csrt;
header->checksum = table_compute_checksum(csrt, header->length);
acpi_add_table(ctx, csrt);
- acpi_inc(ctx, csrt->header.length);
return 0;
}