dtb_object.hh (10508:aa46a8ae3487) dtb_object.hh (10880:61a56f76222b)
1/*
2 * Copyright (c) 2013 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 27 unchanged lines hidden (view full) ---

36/** @file
37 * This implements an object file format to support loading
38 * and modifying flattened device tree blobs for use with
39 * current and future ARM Linux kernels.
40 */
41class DtbObject : public ObjectFile
42{
43 protected:
1/*
2 * Copyright (c) 2013 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 27 unchanged lines hidden (view full) ---

36/** @file
37 * This implements an object file format to support loading
38 * and modifying flattened device tree blobs for use with
39 * current and future ARM Linux kernels.
40 */
41class DtbObject : public ObjectFile
42{
43 protected:
44 DtbObject(const std::string &_filename, int _fd,
45 size_t _len, uint8_t *_data,
44 DtbObject(const std::string &_filename, size_t _len, uint8_t *_data,
46 Arch _arch, OpSys _opSys);
47
48 /** Bool marking if this dtb file has replaced the original
49 * read in DTB file with a new modified buffer
50 */
51 bool fileDataMmapped;
52
53 public:

--- 16 unchanged lines hidden (view full) ---

70 bool loadGlobalSymbols(SymbolTable *symtab,
71 Addr addrMask = std::numeric_limits<Addr>::max());
72 bool loadLocalSymbols(SymbolTable *symtab,
73 Addr addrMask = std::numeric_limits<Addr>::max());
74
75 /** Static function that tries to load file as a
76 * flattened device tree blob.
77 * @param fname path to file
45 Arch _arch, OpSys _opSys);
46
47 /** Bool marking if this dtb file has replaced the original
48 * read in DTB file with a new modified buffer
49 */
50 bool fileDataMmapped;
51
52 public:

--- 16 unchanged lines hidden (view full) ---

69 bool loadGlobalSymbols(SymbolTable *symtab,
70 Addr addrMask = std::numeric_limits<Addr>::max());
71 bool loadLocalSymbols(SymbolTable *symtab,
72 Addr addrMask = std::numeric_limits<Addr>::max());
73
74 /** Static function that tries to load file as a
75 * flattened device tree blob.
76 * @param fname path to file
78 * @param fd file descriptor of object file
79 * @param len length of file
80 * @param data mmap'ed data buffer containing file contents
81 * @return ObjectFile representing closest match of file type
82 */
77 * @param len length of file
78 * @param data mmap'ed data buffer containing file contents
79 * @return ObjectFile representing closest match of file type
80 */
83 static ObjectFile *tryFile(const std::string &fname, int fd,
81 static ObjectFile *tryFile(const std::string &fname,
84 size_t len, uint8_t *data);
85};
86
87#endif //__DTB_OBJECT_HH__
82 size_t len, uint8_t *data);
83};
84
85#endif //__DTB_OBJECT_HH__