From ebd84c6ff466c1f2368dc836b84bf2ec03b1937c Mon Sep 17 00:00:00 2001 From: wlott <wlott> Date: Fri, 24 May 1991 17:57:40 +0000 Subject: [PATCH] Moved OS specific stuff into OS specific files. This file just contains the OS generic stuff (interface definitons, etc). --- ldb/os.h | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/ldb/os.h b/ldb/os.h index 803600290..f8e13413d 100644 --- a/ldb/os.h +++ b/ldb/os.h @@ -1,34 +1,47 @@ /* - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/os.h,v 1.1 1990/06/03 22:37:50 ch Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/os.h,v 1.2 1991/05/24 17:57:40 wlott Exp $ * - * OS-dependent header file. - * - * This is the Mach version. + * Common interface for os-dependent functions. * */ #if !defined(_OS_H_INCLUDED_) -#include <mach.h> -#include "ldb.h" +#define _OS_H_INCLUDED_ + +#ifdef MACH +#include "mach-os.h" +#else +#ifdef sun +#include "sunos-os.h" +#endif +#endif -typedef vm_address_t os_vm_address_t; -typedef vm_size_t os_vm_size_t; -typedef vm_offset_t os_vm_offset_t; -typedef vm_prot_t os_vm_prot_t; +#define OS_VM_PROT_ALL (OS_VM_PROT_READ|OS_VM_PROT_WRITE|OS_VM_PROT_EXECUTE) extern os_vm_size_t os_vm_page_size; -extern void os_validate(); +extern void os_install_interrupt_handlers(); + +extern os_vm_address_t os_allocate(), os_reallocate(); +void os_deallocate(); + +extern os_vm_address_t os_validate(); extern void os_invalidate(); extern void os_zero(); -extern void os_map(); +extern os_vm_address_t os_map(); extern void os_flush_icache(); extern void os_protect(); extern boolean valid_addr(); -#define OS_VM_PROT_READ VM_PROT_READ -#define OS_VM_PROT_WRITE VM_PROT_WRITE -#define OS_VM_PROT_EXECUTE VM_PROT_EXECUTE +#define os_trunc_to_page(addr) \ + (os_vm_address_t)((long)addr&~(os_vm_page_size-1)) +#define os_round_up_to_page(addr) \ + os_trunc_to_page(addr+(os_vm_page_size-1)) + +#define os_trunc_size_to_page(size) \ + (os_vm_size_t)((long)size&~(os_vm_page_size-1)) +#define os_round_up_size_to_page(size) \ + os_trunc_size_to_page(size+(os_vm_page_size-1)) #endif -- GitLab