X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Farch%2Fi386%2Fboot%2Fmpspec.c;h=c6946c2a98f1dba43e2c0bb4654a1ad84fb38ed3;hb=55dc223ccd0bb2a34ec46f36b36b658ecd677c2f;hp=031f326b640bf28062fd72b8765d34930119ec9c;hpb=11abcc0ae529e1a5c562f439df65ac091a322683;p=coreboot.git diff --git a/src/arch/i386/boot/mpspec.c b/src/arch/i386/boot/mpspec.c index 031f326b6..c6946c2a9 100644 --- a/src/arch/i386/boot/mpspec.c +++ b/src/arch/i386/boot/mpspec.c @@ -7,6 +7,30 @@ #include #include +/* Initialize the specified "mc" struct with initial values. */ +void mptable_init(struct mp_config_table *mc, const char *productid, + u32 lapic_addr) +{ + /* Error out if 'product_id' length doesn't match exactly. */ + if (strlen(productid) != 12) + die("ERROR: 'productid' must be 12 bytes long!"); + + memset(mc, 0, sizeof(*mc)); + memcpy(mc->mpc_signature, MPC_SIGNATURE, 4); + mc->mpc_length = sizeof(*mc); /* Initially just the header size. */ + mc->mpc_spec = 0x04; /* MultiProcessor specification 1.4 */ + mc->mpc_checksum = 0; /* Not yet computed. */ + memcpy(mc->mpc_oem, "COREBOOT", 8); + memcpy(mc->mpc_productid, productid, 12); + mc->mpc_oemptr = 0; + mc->mpc_oemsize = 0; + mc->mpc_entry_count = 0; /* No entries yet... */ + mc->mpc_lapic = lapic_addr; + mc->mpe_length = 0; + mc->mpe_checksum = 0; + mc->reserved = 0; +} + unsigned char smp_compute_checksum(void *v, int len) { unsigned char *bytes;