/** * tpm_buf_length() - Return the number of bytes consumed by the data * @buf: A &tpm_buf * * Return: The number of bytes consumed by the buffer
*/
u32 tpm_buf_length(struct tpm_buf *buf)
{ return buf->length;
}
EXPORT_SYMBOL_GPL(tpm_buf_length);
/** * tpm_buf_append() - Append data to an initialized buffer * @buf: A &tpm_buf * @new_data: A data blob * @new_length: Size of the appended data
*/ void tpm_buf_append(struct tpm_buf *buf, const u8 *new_data, u16 new_length)
{ /* Return silently if overflow has already happened. */ if (buf->flags & TPM_BUF_OVERFLOW) return;
/** * tpm_buf_append_handle() - Add a handle * @chip: &tpm_chip instance * @buf: &tpm_buf instance * @handle: a TPM object handle * * Add a handle to the buffer, and increase the count tracking the number of * handles in the command buffer. Works only for command buffers.
*/ void tpm_buf_append_handle(struct tpm_chip *chip, struct tpm_buf *buf, u32 handle)
{ if (buf->flags & TPM_BUF_TPM2B) {
dev_err(&chip->dev, "Invalid buffer type (TPM2B)\n"); return;
}
/** * tpm_buf_read_u8() - Read 8-bit word from a TPM buffer * @buf: &tpm_buf instance * @offset: offset within the buffer * * Return: next 8-bit word
*/
u8 tpm_buf_read_u8(struct tpm_buf *buf, off_t *offset)
{
u8 value = 0;
/** * tpm_buf_read_u16() - Read 16-bit word from a TPM buffer * @buf: &tpm_buf instance * @offset: offset within the buffer * * Return: next 16-bit word
*/
u16 tpm_buf_read_u16(struct tpm_buf *buf, off_t *offset)
{
u16 value = 0;
/** * tpm_buf_read_u32() - Read 32-bit word from a TPM buffer * @buf: &tpm_buf instance * @offset: offset within the buffer * * Return: next 32-bit word
*/
u32 tpm_buf_read_u32(struct tpm_buf *buf, off_t *offset)
{
u32 value = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.