<commit_before>/**
 * @file clock.h
 * Definitions relating to the hardware clock and the Xinu clock interrupt.
 */
/* Embedded Xinu, Copyright (C) 2009, 2013.  All rights reserved. */

#ifndef _CLOCK_H_
#define _CLOCK_H_

#include <queue.h>
#include <stddef.h>

/**
 * @ingroup timer
 *
 * Timer resolution.  This refers to the maximum number of times that Xinu
 * schedules the timer interrupt per second, @a not to the number of native
 * clock cycles per second.
 */
#define CLKTICKS_PER_SEC  1000

extern volatile ulong clkticks;
extern volatile ulong clktime;
extern qid_typ sleepq;

/* Clock function prototypes.  Note:  clkupdate() and clkcount() are documented
 * here because their implementations are platform-dependent.  */

void clkinit(void);
<commit_msg>works on qemu But still problem persist with timer interrupt, it generates interrupt for first time but fails to produce second time onwards. Done small tweak to get it. But sleep function become useless. This version can not be trusted whenever we  deal with thread sleep and preemption.<commit_after>/**
 * @file clock.h
 * Definitions relating to the hardware clock and the Xinu clock interrupt.
 */
/* Embedded Xinu, Copyright (C) 2009, 2013.  All rights reserved. */

#ifndef _CLOCK_H_
#define _CLOCK_H_

#include <queue.h>
#include <stddef.h>

/**
 * @ingroup timer
 *
 * Timer resolution.  This refers to the maximum number of times that Xinu
 * schedules the timer interrupt per second, @a not to the number of native
 * clock cycles per second.
 */
 
 /*Due to a combination of the VIC emulator and the timer routine being too slow. Emulator will not work values >=90*/
 
#ifdef ARM_QEMU 
  #define CLKTICKS_PER_SEC  10
#else
   #define CLKTICKS_PER_SEC  1000
#endif

extern volatile ulong clkticks;
extern volatile ulong clktime;
extern qid_typ sleepq;

/* Clock function prototypes.  Note:  clkupdate() and clkcount() are documented
 * here because their implementations are platform-dependent.  */

void clkinit(void);

{'fraction_non_alphanumeric': 0.076, 'fraction_numerical': 0.014, 'mean_word_length': 4.0786802030456855, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573247', 'n_tokens_mistral': 633, 'n_tokens_neox': 569, 'n_words': 261}