
/***    Kernel clock Services
 *
 *      IBM/Microsoft Confidential
 *
 *      Copyright (c) IBM Corporation  1987, 1991
 *      Copyright (c) Microsoft Corp.  1987, 1991
 *      All Rights Reserved
 *
 *      DESCRIPTION
 *      This module contains all the kernel clock services.
 *
 *      MODIFICATION HISTORY
 *      04/08/91 PAT            Created
 */


/***    include files
 */

#define INCL_TYPES              //for basedef.h typedefs
#define INCL_ERRORS             //for bseerr.h defines

#include <basedef.h>
#include <basemac.h>
#include <ostypes.h>


/***    definitions and macros
 */

#ifdef  MISCSTRICT
#  define AssertNONZERO(t)      _assert(t)
#else
#  define AssertNONZERO(t)
#endif


/***    type definitions
 */

typedef (PASCAL FAR32 *PFNFREQ)(ULONG);


/***    data declarations
 */

PFNFREQ f32pfnCLKFreq = 0;

/***    Local function prototypes
 */

ULONG FreqSet(ULONG);

#pragma code_seg("_TEXT", "CODE")


/***EP  FreqSet - sets periodic interrupt frequency
 *
 *      This routine allows the kernel to change the frequency
 *      of the periodic interrupt "ticks" coming from the real time clock.
 *
 *      ENTRY
 *          ulFreq     = periodic frequency in Hz
 *
 *      EXIT-SUCCESS
 *          returns 0
 *
 *      EXIT-FAILURE
 *          returns error code - ERROR_INVALID_FREQUENCY
 *
 *      CONTEXT
 *          Task, Interrupt
 *
 *      PSEUDOCODE
 *
 *      COMMENTS
 *          As per DCR 1345, the kernel will program the periodic frequency
 *          at either its normal rate of 32Hz, or a 4X rate of 128Hz if a
 *          high-resolution timer is immediately pending.  This may occur
 *          several times a second.  Only tom.c calls this routine, passing
 *          either 32 or 128Hz.  For speed, we do not check for invalid
 *          frequency.
 *
 */

ULONG FreqSet(ULONG ulFreq)
{
    AssertNONZERO(f32pfnCLKFreq);

    (*f32pfnCLKFreq)(ulFreq);

    return 0;

}       /* FreqSet */


