/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */
#include <hw.h>
#include <iostypes.h>
#include <ioslibc.h>
#include <arm.h>
#include <sys.h>

extern u32 __iosDisableInt(void);
extern void __iosRestoreInt(u32 mask);
#define LOCK_AHB  __iosDisableInt
#define UNLOCK_AHB(mask)  __iosRestoreInt((mask))

void
iosFlushMem(int flushGroup)
{
    u32 mask = LOCK_AHB();
    /* XXX horti: Access control here ? */
    ahbMemFlush(flushGroup);
    UNLOCK_AHB(mask);
    return;
}

void
iosInvalidateRdb(int readBuffer)
{
    u32 mask = LOCK_AHB();
    /* XXX horti: Access control here ? */
    ahbMemRBInvalidate(readBuffer);
    UNLOCK_AHB(mask);
    return;
}
