debug code cleanup
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7479 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9b4b9246a3
commit
6000570ec3
@ -30,6 +30,7 @@
|
||||
#define DEBUG_INIT 1
|
||||
#define DEBUG_IOCTL 1
|
||||
#define DEBUG_HW 1
|
||||
#define DEBUG_TRACE_STATS 1
|
||||
#define DBG_STATS 1
|
||||
|
||||
#else
|
||||
@ -41,6 +42,7 @@
|
||||
#define DEBUG_INIT 0
|
||||
#define DEBUG_IOCTL 0
|
||||
#define DEBUG_HW 0
|
||||
#define DEBUG_TRACE_STATS 0
|
||||
#undef DBG_STATS
|
||||
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
/*********************************************************************
|
||||
* Set this to one to display debug statistics
|
||||
*********************************************************************/
|
||||
int em_display_debug_stats = 1;
|
||||
int em_display_debug_stats = DEBUG_TRACE_STATS;
|
||||
|
||||
/*********************************************************************
|
||||
* Function prototypes
|
||||
|
@ -20,13 +20,12 @@
|
||||
#include <OS.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DEBUG 1
|
||||
|
||||
#include "debug.h"
|
||||
#include "timer.h"
|
||||
|
||||
#define MAX_TIMERS 32
|
||||
|
||||
|
||||
struct timer_info
|
||||
{
|
||||
timer_id id;
|
||||
@ -37,6 +36,7 @@ struct timer_info
|
||||
bool periodic;
|
||||
};
|
||||
|
||||
|
||||
static struct timer_info sTimerData[MAX_TIMERS];
|
||||
static int sTimerCount;
|
||||
static timer_id sTimerNextId;
|
||||
@ -44,13 +44,12 @@ static thread_id sTimerThread;
|
||||
static sem_id sTimerSem;
|
||||
static spinlock sTimerSpinlock;
|
||||
|
||||
|
||||
static int32
|
||||
timer_thread(void *cookie)
|
||||
{
|
||||
status_t status = 0;
|
||||
|
||||
TRACE("timer_thread enter\n");
|
||||
|
||||
do {
|
||||
bigtime_t timeout;
|
||||
bigtime_t now;
|
||||
@ -77,8 +76,6 @@ timer_thread(void *cookie)
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("timer index %d\n", index);
|
||||
|
||||
if (timeout < now) {
|
||||
// timer is ready for execution, load func and cookie
|
||||
ASSERT(index >= 0 && index < sTimerCount);
|
||||
@ -109,8 +106,6 @@ timer_thread(void *cookie)
|
||||
status = acquire_sem_etc(sTimerSem, 1, B_ABSOLUTE_TIMEOUT, timeout);
|
||||
} while (status == B_OK || status == B_TIMED_OUT);
|
||||
|
||||
TRACE("timer_thread leave\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -121,8 +116,6 @@ create_timer(timer_function func, void *cookie, bigtime_t interval, uint32 flags
|
||||
cpu_status cpu;
|
||||
timer_id id;
|
||||
|
||||
TRACE("create_timer enter\n");
|
||||
|
||||
if (func == 0)
|
||||
return -1;
|
||||
|
||||
@ -151,8 +144,6 @@ create_timer(timer_function func, void *cookie, bigtime_t interval, uint32 flags
|
||||
if (id != -1)
|
||||
release_sem_etc(sTimerSem, 1, B_DO_NOT_RESCHEDULE);
|
||||
|
||||
TRACE("create_timer leave\n");
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -164,8 +155,6 @@ delete_timer(timer_id id)
|
||||
bool deleted;
|
||||
int i;
|
||||
|
||||
TRACE("delete_timer enter\n");
|
||||
|
||||
deleted = false;
|
||||
|
||||
cpu = disable_interrupts();
|
||||
@ -185,8 +174,6 @@ delete_timer(timer_id id)
|
||||
release_spinlock(&sTimerSpinlock);
|
||||
restore_interrupts(cpu);
|
||||
|
||||
TRACE("delete_timer leave\n");
|
||||
|
||||
if (!deleted)
|
||||
return B_ERROR;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user