summaryrefslogtreecommitdiff
path: root/tpm.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-29tpm.c: Don't try to put -1 in a variable of type TpmModelPeter Maydell1-2/+2
The TpmModel type is an enum (valid values 0 and 1), which means the compiler can legitimately decide that comparisons like 'tpm_models[i] == -1' are never true. (For example it could pick 'unsigned char' as its type for representing the enum.) Avoid this issue by using TPM_MODEL_MAX to mark entries in the tpm_models[] array which aren't filled in, instead of -1. This silences a clang warning: tpm.c:43:27: error: comparison of constant -1 with expression of type 'enum TpmModel' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (tpm_models[i] == -1) { ~~~~~~~~~~~~~ ^ ~~ Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1375096931-13842-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-23Move TPM passthrough specific command line options to backend structureStefan Berger1-0/+8
Move the TPM passthrough specific command line options to the passthrough backend implementation and attach them to the backend's interface structure. Add code to tpm.c for validating the TPM command line options. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Corey Bryan <coreyb@linux.vnet.ibm.com> Message-id: 1366641699-21420-1-git-send-email-stefanb@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15sysemu: avoid proliferation of include/ subdirectoriesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-15tpm: reorganize headers and split hardware partPaolo Bonzini1-0/+350
The TPM subsystem does not have a full front-end/back-end separation. The sole available backend, tpm_passthrough, depends on the data structures of the sole available frontend, tpm_tis. However, we can at least try to split the user interface (tpm.c) from the implementation (hw/tpm). The patches makes tpm.c not include tpm_int.h, which is shared between tpm_tis.c and tpm_passthrough.c; instead it moves more stuff to tpm_backend.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>