Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 1787004: TPM Lite: Add a "firmware" target for building TPM Lite (Closed)

Created:
10 years, 8 months ago by gauravsh
Modified:
9 years, 6 months ago
Reviewers:
Luigi Semenzato
CC:
chromium-os-reviews_chromium.org, Luigi Semenzato
Visibility:
Public.

Description

TPM Lite: Add a "firmware" target for building TPM Lite This CL adds a firmware target for standalone compilation of TPM lite for use in the firmware. In particular, it removes dependencies on external Trouser TSS headers and uses the snapshot version of structures.h which define TPM command structures. I also removed the include/ directory and moved the tlcl.h header to src/tlcl/ since I think that having a separate directory for just a single header file seems overkill.

Patch Set 1 #

Patch Set 2 : add the new tss constants header #

Total comments: 8

Patch Set 3 : review fixes #

Patch Set 4 : change output file name. change to #ifdefs #

Total comments: 2

Patch Set 5 : Add a separate makefile for firmware compilation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -38 lines) Patch
M src/platform/tpm_lite/src/Makefile View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M src/platform/tpm_lite/src/testsuite/Makefile View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/tpm_lite/src/tlcl/Makefile View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
A src/platform/tpm_lite/src/tlcl/Makefile.firmware View 1 chunk +16 lines, -0 lines 0 comments Download
A + src/platform/tpm_lite/src/tlcl/saved-structures.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + src/platform/tpm_lite/src/tlcl/tlcl.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/platform/tpm_lite/src/tlcl/tlcl.c View 1 2 3 4 10 chunks +37 lines, -32 lines 0 comments Download
M src/platform/tpm_lite/src/tlcl/tlcl_internal.h View 1 chunk +1 line, -1 line 0 comments Download
A src/platform/tpm_lite/src/tlcl/tss_constants.h View 2 1 chunk +61 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
gauravsh
10 years, 8 months ago (2010-04-27 01:52:04 UTC) #1
Luigi Semenzato
Looks good---just a couple of comments, mostly in the Makefile. Going to bed now---next review ...
10 years, 8 months ago (2010-04-27 04:52:31 UTC) #2
gauravsh
http://codereview.chromium.org/1787004/diff/3001/4003 File src/platform/tpm_lite/src/tlcl/Makefile (right): http://codereview.chromium.org/1787004/diff/3001/4003#newcode35 src/platform/tpm_lite/src/tlcl/Makefile:35: $(CC) -c -Wall -Werror -ansi -DFIRMWARE tlcl.c On 2010/04/27 ...
10 years, 8 months ago (2010-04-27 18:03:58 UTC) #3
Luigi Semenzato
On Tue, Apr 27, 2010 at 11:03 AM, <gauravsh@chromium.org> wrote: > > http://codereview.chromium.org/1787004/diff/3001/4003 > File ...
10 years, 8 months ago (2010-04-27 18:13:25 UTC) #4
gauravsh
On 2010/04/27 18:13:25, Luigi Semenzato wrote: > On Tue, Apr 27, 2010 at 11:03 AM, ...
10 years, 8 months ago (2010-04-27 18:20:38 UTC) #5
Luigi Semenzato
LGTM optionally consider the Makefile issues
10 years, 8 months ago (2010-04-27 20:06:31 UTC) #6
Luigi Semenzato
Sorry, forgot to publish + mail. http://codereview.chromium.org/1787004/diff/17001/18003 File src/platform/tpm_lite/src/tlcl/Makefile (right): http://codereview.chromium.org/1787004/diff/17001/18003#newcode33 src/platform/tpm_lite/src/tlcl/Makefile:33: $(CC) -Wall -Werror ...
10 years, 8 months ago (2010-04-27 20:52:21 UTC) #7
gauravsh
10 years, 8 months ago (2010-04-27 21:00:50 UTC) #8
On 2010/04/27 20:52:21, Luigi Semenzato wrote:
> Sorry, forgot to publish + mail.
> 
> http://codereview.chromium.org/1787004/diff/17001/18003
> File src/platform/tpm_lite/src/tlcl/Makefile (right):
> 
> http://codereview.chromium.org/1787004/diff/17001/18003#newcode33
> src/platform/tpm_lite/src/tlcl/Makefile:33: $(CC) -Wall -Werror -ansi
-DFIRMWARE
> -c tlcl.c -o tlcl.o
> -o tlcl.o is redundant.
> -Wall -Werror should be $(CFLAGS), no?
> 
> Well OK.  I didn't give good feedback.  I thought the additional target
> (firmware) would be in the top-level Makefile (in ..).  Right now the other
> compilations are started there---this Makefile was not meant to be invoked
> directly.  If you do that, the Makefile structure becomes more uniform.  It
> would be nice to use the same rule (the implicit rule) for all targets.
> 
> I am thinking of something like this:
> 
> ifeq ($(FIRMWARE), 1)
> CFLAGS += -DFIRMWARE -ansi
> STRUCTURES_H = saved-structures.h
> else
> STRUCTURES_H = structures.h
> endif
> 
> tlcl.o: tlcl.c tlcl_internal.h tlcl.h $(STRUCTURES_H)
> 
> and no special firmware rule.
> 
> If you prefer to have the directory be self-contained, maybe it's cleaner to
> have a completely separate Makefile.firmware.  Right now the only thing you
> share is $(CC)---might as well.

I like this idea. It makes it clear what is needed to be done differently for
firmware compilation. Done.

> 
> Otherwise I'd keep it the way you had it earlier, with
> 
> firmware: tlcl.o
> 
> tlcl.o: tlcl.c etc.
>        etc.
> 
> http://codereview.chromium.org/1787004/diff/17001/18005
> File src/platform/tpm_lite/src/tlcl/tlcl.c (right):
> 
> http://codereview.chromium.org/1787004/diff/17001/18005#newcode27
> src/platform/tpm_lite/src/tlcl/tlcl.c:27: #ifndef FIRMWARE
> Complete nit, and it started this way, but since there is both a then and an
> else part, maybe switch them around and use #ifdef instead of #ifndef? 
> Completely optional.

Done.

Powered by Google App Engine
This is Rietveld 408576698