X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Ftypes%2Finteger.c;h=257341adfa41ce6320a68a00e04cf6bc4d43490f;hb=ecc54f11c258cad6b54d35da83e525d32c032397;hp=5b56227d85d4d0ccfbd323aa52d3804c31d3682b;hpb=9b0422a038d313a812e1c862122ec1f2b70add9a;p=babeltrace.git diff --git a/formats/ctf/types/integer.c b/formats/ctf/types/integer.c index 5b56227d..257341ad 100644 --- a/formats/ctf/types/integer.c +++ b/formats/ctf/types/integer.c @@ -16,6 +16,14 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -31,8 +39,8 @@ */ static -int _aligned_integer_read(struct stream_pos *ppos, - struct definition *definition) +int _aligned_integer_read(struct bt_stream_pos *ppos, + struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -133,8 +141,8 @@ int _aligned_integer_read(struct stream_pos *ppos, } static -int _aligned_integer_write(struct stream_pos *ppos, - struct definition *definition) +int _aligned_integer_write(struct bt_stream_pos *ppos, + struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -203,7 +211,7 @@ end: return 0; } -int ctf_integer_read(struct stream_pos *ppos, struct definition *definition) +int ctf_integer_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -223,20 +231,24 @@ int ctf_integer_read(struct stream_pos *ppos, struct definition *definition) if (!integer_declaration->signedness) { if (integer_declaration->byte_order == LITTLE_ENDIAN) - bt_bitfield_read_le(pos->base, unsigned long, + bt_bitfield_read_le(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, &integer_definition->value._unsigned); else - bt_bitfield_read_be(pos->base, unsigned long, + bt_bitfield_read_be(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, &integer_definition->value._unsigned); } else { if (integer_declaration->byte_order == LITTLE_ENDIAN) - bt_bitfield_read_le(pos->base, unsigned long, + bt_bitfield_read_le(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, &integer_definition->value._signed); else - bt_bitfield_read_be(pos->base, unsigned long, + bt_bitfield_read_be(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, &integer_definition->value._signed); } @@ -244,7 +256,7 @@ int ctf_integer_read(struct stream_pos *ppos, struct definition *definition) return 0; } -int ctf_integer_write(struct stream_pos *ppos, struct definition *definition) +int ctf_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -266,20 +278,24 @@ int ctf_integer_write(struct stream_pos *ppos, struct definition *definition) goto end; if (!integer_declaration->signedness) { if (integer_declaration->byte_order == LITTLE_ENDIAN) - bt_bitfield_write_le(pos->base, unsigned long, + bt_bitfield_write_le(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, integer_definition->value._unsigned); else - bt_bitfield_write_be(pos->base, unsigned long, + bt_bitfield_write_be(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, integer_definition->value._unsigned); } else { if (integer_declaration->byte_order == LITTLE_ENDIAN) - bt_bitfield_write_le(pos->base, unsigned long, + bt_bitfield_write_le(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, integer_definition->value._signed); else - bt_bitfield_write_be(pos->base, unsigned long, + bt_bitfield_write_be(mmap_align_addr(pos->base_mma) + + pos->mmap_base_offset, unsigned long, pos->offset, integer_declaration->len, integer_definition->value._signed); }