From 87d1d08196ed2c69d4736a2815135bb69d996d11 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Mon, 22 Dec 2014 05:58:57 -0500 Subject: ich9deblob: add more commenting --- (limited to 'resources/utilities/ich9deblob/ich9desc.c') diff --git a/resources/utilities/ich9deblob/ich9desc.c b/resources/utilities/ich9deblob/ich9desc.c index c3e1edf..b852497 100644 --- a/resources/utilities/ich9deblob/ich9desc.c +++ b/resources/utilities/ich9deblob/ich9desc.c @@ -1,5 +1,6 @@ /* * ich9desc.c + * This file is part of the ich9deblob utility from the libreboot project * * Copyright (C) 2014 Steve Shenton * Francis Rowe @@ -17,18 +18,37 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +// Purpose: provide struct representing descriptor region. +// Map actual buffers of this regions, directly to instances of these +// structs. This makes working with descriptor really easy. + +// bit fields used, corresponding to datasheet. See links to datasheets +// and documentation in ich9deblob.c struct FLVALSIG{ unsigned int signature; }; struct FLMAP0 { + // least signicant bits unsigned char FCBA : 8; unsigned char NC : 2; unsigned char : 6; + // ^^^^ unnamed members like these represent unused bits (per datasheet). + // the same applies for all structs in this file. unsigned char FRBA : 8; unsigned char NR : 3; unsigned char : 5; + // most significant bits. + + // the datasheet lists msb's first and lsb's last, in each table. + // meanwhile, x86 gcc treats the members at the top of the struct as lsb's + // and at the bottom of the struct, the members there are msb's. The same + // fact applies to all the other structs below. + + // non-x86 (and/or non-gcc) is untested + // little endian assumed }; struct FLMAP1 { -- cgit v0.9.1