packet.hh (7823:dac01f14f20f) | packet.hh (7915:bc39c93a5519) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 667 unchanged lines hidden (view full) --- 676 flags.set(DYNAMIC_DATA); 677 } 678 679 /** 680 * get a pointer to the data ptr. 681 */ 682 template <typename T> 683 T* | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 667 unchanged lines hidden (view full) --- 676 flags.set(DYNAMIC_DATA); 677 } 678 679 /** 680 * get a pointer to the data ptr. 681 */ 682 template <typename T> 683 T* |
684 getPtr() | 684 getPtr(bool null_ok = false) |
685 { | 685 { |
686 assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA)); | 686 assert(null_ok || flags.isSet(STATIC_DATA|DYNAMIC_DATA)); |
687 return (T*)data; 688 } 689 690 /** 691 * return the value of what is pointed to in the packet. 692 */ 693 template <typename T> 694 T get(); --- 68 unchanged lines hidden (view full) --- 763 return; 764 } 765 766 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA)); 767 flags.set(DYNAMIC_DATA|ARRAY_DATA); 768 data = new uint8_t[getSize()]; 769 } 770 | 687 return (T*)data; 688 } 689 690 /** 691 * return the value of what is pointed to in the packet. 692 */ 693 template <typename T> 694 T get(); --- 68 unchanged lines hidden (view full) --- 763 return; 764 } 765 766 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA)); 767 flags.set(DYNAMIC_DATA|ARRAY_DATA); 768 data = new uint8_t[getSize()]; 769 } 770 |
771 | |
772 /** 773 * Check a functional request against a memory value represented 774 * by a base/size pair and an associated data array. If the 775 * functional request is a read, it may be satisfied by the memory 776 * value. If the functional request is a write, it may update the 777 * memory value. 778 */ 779 bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data); --- 38 unchanged lines hidden --- | 771 /** 772 * Check a functional request against a memory value represented 773 * by a base/size pair and an associated data array. If the 774 * functional request is a read, it may be satisfied by the memory 775 * value. If the functional request is a write, it may update the 776 * memory value. 777 */ 778 bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data); --- 38 unchanged lines hidden --- |