/* Copyright 1999 Pace Micro Technology plc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *  AsmUtils (heapswis.h)
 *
 * Copyright (C) Pace Micro Technology plc. 1999
 *
 */
#ifndef asmutils_heapswis_h_inluded
#define asmutils_heapswis_h_inluded

#ifdef __cplusplus
extern "C" {
#endif

/* Fast veneers to OS_Heap used by various components in the build.
 * These functions correspond to the R0 sub-reason codes of OS_Heap,
 * respectively: 0 (initialise), 2 (allocate), 3 (free), 4 (resize block),
 * 5 (resize heap), 6 (read size of block).
 *
 * See PRM volume 1 for details.
 */

extern _kernel_oserror *xosheap_initialise(void *heap, size_t size);
extern _kernel_oserror *xosheap_alloc(void *heap, size_t size, void **p);
extern _kernel_oserror *xosheap_free(void *heap, void *p);
extern _kernel_oserror *xosheap_realloc(void *heap, void *p, int by, void **newp);
extern _kernel_oserror *xosheap_resize(void *heap, int by);
extern _kernel_oserror *xosheap_read_size(void *heap, void *p, size_t *size);

#ifdef __cplusplus
}
#endif

#endif
