aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-07-17 18:27:14 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2023-07-17 22:49:46 +0900
commitcccf9cc2a9185ae51660971e8b53478c691629cd (patch)
tree1405bd2559380fb0354a8e049ec0b910017db1a9
parentd185faa9e19cfe1c35e37b799141f93af0b92640 (diff)
downloadlibhinoko-cccf9cc2a9185ae51660971e8b53478c691629cd.tar.gz
cycle_timer: drop Hinoko.CycleTimer
Hinoko.CycleTimer is not used anymore. Let us delete it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--src/cycle_timer.c105
-rw-r--r--src/cycle_timer.h27
-rw-r--r--src/hinoko.h2
-rw-r--r--src/hinoko.map6
-rw-r--r--src/meson.build2
-rw-r--r--tests/cycle-timer21
-rw-r--r--tests/meson.build1
7 files changed, 0 insertions, 164 deletions
diff --git a/src/cycle_timer.c b/src/cycle_timer.c
deleted file mode 100644
index 03e6cd1..0000000
--- a/src/cycle_timer.c
+++ /dev/null
@@ -1,105 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-#include "fw_iso_ctx_private.h"
-
-/**
- * HinokoCycleTimer:
- * A boxed object to express data of cycle timer.
- *
- * A [struct@CycleTimer] expresses the value of cycle timer of 1394 OHCI and timestamp referring
- * to clock_id.
- */
-HinokoCycleTimer *hinoko_cycle_timer_copy(const HinokoCycleTimer *self)
-{
-#ifdef g_memdup2
- return g_memdup2(self, sizeof(*self));
-#else
- // GLib v2.68 deprecated g_memdup() with concern about overflow by narrow conversion from
- // size_t to unsigned int in ABI for LP64 data model.
- gpointer ptr = g_malloc(sizeof(*self));
- memcpy(ptr, self, sizeof(*self));
- return ptr;
-#endif
-}
-
-G_DEFINE_BOXED_TYPE(HinokoCycleTimer, hinoko_cycle_timer, hinoko_cycle_timer_copy, g_free)
-
-/**
- * hinoko_cycle_timer_new:
- *
- * Allocate and return an instance of [struct@CycleTimer].
- *
- * Returns: (transfer none): An instance of [struct@CycleTimer].
- */
-HinokoCycleTimer *hinoko_cycle_timer_new()
-{
- return g_malloc0(sizeof(HinokoCycleTimer));
-}
-
-/**
- * hinoko_cycle_timer_get_timestamp:
- * @self: A [struct@CycleTimer].
- * @tv_sec: (out): The second part of timestamp.
- * @tv_nsec: (out): The nanosecond part of timestamp.
- *
- * Get timestamp with enough size of strorage. The timestamp refers to clock_id available by
- * [method@CycleTimer.get_clock_id].
- */
-void hinoko_cycle_timer_get_timestamp(HinokoCycleTimer *self, gint64 *tv_sec,
- gint32 *tv_nsec)
-{
- *tv_sec = self->tv_sec;
- *tv_nsec = self->tv_nsec;
-}
-
-/**
- * hinoko_cycle_timer_get_clock_id:
- * @self: A [struct@CycleTimer].
- * @clock_id: (out): The numerical ID of clock source for the reference timestamp. One of
- * CLOCK_REALTIME(0), CLOCK_MONOTONIC(1), and CLOCK_MONOTONIC_RAW(4) is available in
- * UAPI of Linux kernel.
- *
- * Get the ID of clock for timestamp.
- */
-void hinoko_cycle_timer_get_clock_id(HinokoCycleTimer *self, gint *clock_id)
-{
- *clock_id = self->clk_id;
-}
-
-#define IEEE1394_CYCLE_TIMER_SEC_MASK 0xfe000000
-#define IEEE1394_CYCLE_TIMER_SEC_SHIFT 25
-#define IEEE1394_CYCLE_TIMER_CYCLE_MASK 0x01fff000
-#define IEEE1394_CYCLE_TIMER_CYCLE_SHIFT 12
-#define IEEE1394_CYCLE_TIMER_OFFSET_MASK 0x00000fff
-
-static guint ieee1394_cycle_timer_to_sec(guint32 cycle_timer)
-{
- return (cycle_timer & IEEE1394_CYCLE_TIMER_SEC_MASK) >> IEEE1394_CYCLE_TIMER_SEC_SHIFT;
-}
-
-static guint ieee1394_cycle_timer_to_cycle(guint32 cycle_timer)
-{
- return (cycle_timer & IEEE1394_CYCLE_TIMER_CYCLE_MASK) >> IEEE1394_CYCLE_TIMER_CYCLE_SHIFT;
-}
-
-static guint ieee1394_cycle_timer_to_offset(guint32 cycle_timer)
-{
- return cycle_timer & IEEE1394_CYCLE_TIMER_OFFSET_MASK;
-}
-
-/**
- * hinoko_cycle_timer_get_cycle_timer:
- * @self: A [struct@CycleTimer].
- * @cycle_timer: (array fixed-size=3)(out caller-allocates): The value of cycle timer register of
- * 1394 OHCI, including three elements; second, cycle, and offset.
- *
- * Get the value of cycle timer in 1394 OHCI controller. The first element of array expresses the
- * value of sec field, up to 127. The second element of array expresses the value of cycle field,
- * up to 7999. The third element of array expresses the value of offset field, up to 3071.
- */
-void hinoko_cycle_timer_get_cycle_timer(HinokoCycleTimer *self,
- guint16 cycle_timer[3])
-{
- cycle_timer[0] = ieee1394_cycle_timer_to_sec(self->cycle_timer);
- cycle_timer[1] = ieee1394_cycle_timer_to_cycle(self->cycle_timer);
- cycle_timer[2] = ieee1394_cycle_timer_to_offset(self->cycle_timer);
-}
diff --git a/src/cycle_timer.h b/src/cycle_timer.h
deleted file mode 100644
index 3ed75d7..0000000
--- a/src/cycle_timer.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-#ifndef __HINOKO_CYCLE_TIMER_H__
-#define __HINOKO_CYCLE_TIMER_H__
-
-#include <hinoko.h>
-
-G_BEGIN_DECLS
-
-#define HINOKO_TYPE_CYCLE_TIMER (hinoko_cycle_timer_get_type())
-
-typedef struct fw_cdev_get_cycle_timer2 HinokoCycleTimer;
-
-GType hinoko_cycle_timer_get_type() G_GNUC_CONST;
-
-HinokoCycleTimer *hinoko_cycle_timer_new();
-
-void hinoko_cycle_timer_get_timestamp(HinokoCycleTimer *self, gint64 *tv_sec,
- gint32 *tv_nsec);
-
-void hinoko_cycle_timer_get_clock_id(HinokoCycleTimer *self, gint *clock_id);
-
-void hinoko_cycle_timer_get_cycle_timer(HinokoCycleTimer *self,
- guint16 cycle_timer[3]);
-
-G_END_DECLS
-
-#endif
diff --git a/src/hinoko.h b/src/hinoko.h
index cc51376..d204ab8 100644
--- a/src/hinoko.h
+++ b/src/hinoko.h
@@ -15,8 +15,6 @@
#include <hinoko_enum_types.h>
#include <hinoko_enums.h>
-#include <cycle_timer.h>
-
#include <fw_iso_ctx.h>
#include <fw_iso_ir_single.h>
#include <fw_iso_ir_multiple.h>
diff --git a/src/hinoko.map b/src/hinoko.map
index 253a4aa..401162d 100644
--- a/src/hinoko.map
+++ b/src/hinoko.map
@@ -8,12 +8,6 @@ HINOKO_0_1_0 {
};
HINOKO_0_3_0 {
- global:
- "hinoko_cycle_timer_get_type";
- "hinoko_cycle_timer_new";
- "hinoko_cycle_timer_get_timestamp";
- "hinoko_cycle_timer_get_clock_id";
- "hinoko_cycle_timer_get_cycle_timer";
} HINOKO_0_1_0;
HINOKO_0_4_0 {
diff --git a/src/meson.build b/src/meson.build
index 3f1684a..6efcb7f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -13,7 +13,6 @@ sources = [
'fw_iso_ir_single.c',
'fw_iso_ir_multiple.c',
'fw_iso_it.c',
- 'cycle_timer.c',
'fw_iso_resource.c',
'fw_iso_resource_auto.c',
'fw_iso_resource_once.c',
@@ -25,7 +24,6 @@ headers = [
'fw_iso_ir_single.h',
'fw_iso_ir_multiple.h',
'fw_iso_it.h',
- 'cycle_timer.h',
'fw_iso_resource.h',
'fw_iso_resource_auto.h',
'fw_iso_resource_once.h',
diff --git a/tests/cycle-timer b/tests/cycle-timer
deleted file mode 100644
index f011ae1..0000000
--- a/tests/cycle-timer
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python3
-
-from sys import exit
-from errno import ENXIO
-
-from helper import test_struct
-
-import gi
-gi.require_version('Hinoko', '0.0')
-from gi.repository import Hinoko
-
-target_type = Hinoko.CycleTimer
-methods = (
- 'new',
- 'get_timestamp',
- 'get_clock_id',
- 'get_cycle_timer',
-)
-
-if not test_struct(target_type, methods):
- exit(ENXIO)
diff --git a/tests/meson.build b/tests/meson.build
index 6b4c1cc..af32b19 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -7,7 +7,6 @@ tests = [
'fw-iso-resource',
'fw-iso-resource-auto',
'fw-iso-resource-once',
- 'cycle-timer',
'hinoko-functions',
]