blob: af12df81d0298db1a6e62ce6d63455f622962c16 [file] [log] [blame]
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _BOOTCACHE_H
#define _BOOTCACHE_H
#include <linux/types.h>
enum { BLK_SHIFT = 12,
BLK_SIZE = 1<<BLK_SHIFT,
BLK_MASK = BLK_SIZE - 1,
SECTOR_BLOCK_SHIFT = 3,
BOOTCACHE_MAGIC = 1651470196,
BOOTCACHE_VERSION = 2,
MAX_SIGNATURE = 256
};
#define BLK_ALIGN(_x) (((_x) + BLK_MASK) >> BLK_SHIFT)
struct Trace {
__u64 blkno; /* Block number for data */
__u64 count; /* Number of blocks in request */
__u64 ino; /* Used for anaysis of traces */
};
struct Bootcache_hdr {
__u64 blkno; /* Block number for where header is stored */
__u32 magic; /* Magic number */
__u32 version; /* Verion of boot cache */
__u32 state; /* Curent state */
__u32 num_blks_meta; /* Size of trace data on disk */
__u32 num_blks_data; /* Size of the data area */
char date[12]; /* Date and time bootcache was compiled */
char time[12];
__u32 max_sectors; /* Max sectors that can to read */
__u32 max_hw_sectors; /* Max hardware sectore that can be read */
char signature[MAX_SIGNATURE];
};
#endif