Ticket #3763: headers.diff

File headers.diff, 34.2 KB (added by pfoetchen_, 15 years ago)

added/modified headers

  • headers/os/kernel/OS.h

     
    659659    B_MK_61_PLATFORM,
    660660    B_NINTENDO_64_PLATFORM,
    661661    B_AMIGA_PLATFORM,
    662     B_ATARI_PLATFORM
     662    B_ATARI_PLATFORM,
     663    B_BEAGLEBOARD_PLATFORM
    663664} platform_type;
    664665
    665666typedef struct {
  • headers/os/kernel/debugger.h

     
    1717    #include <arch/ppc/arch_debugger.h>
    1818#elif __M68K__
    1919    #include <arch/m68k/arch_debugger.h>
     20#elif __ARM__
     21    #include <arch/arm/arch_debugger.h>
    2022#else
    2123    #error you need to write a <arch/<cpu>/arch_debugger.h>
    2224#endif
  • headers/os/arch/arm/arch_debugger.h

     
     1/*
     2 * Copyright 2005, Haiku Inc.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _ARCH_ARM_DEBUGGER_H
     6#define _ARCH_ARM_DEBUGGER_H
     7
     8struct debug_cpu_state {
     9    uint32  r0;
     10    uint32  r1;
     11    uint32  r2;
     12    uint32  r3;
     13    uint32  r4;
     14    uint32  r5;
     15    uint32  r6;
     16    uint32  r7;
     17    uint32  r8;
     18    uint32  r9;
     19    uint32  r10;
     20    uint32  r11;
     21    uint32  r12;
     22    uint32  r13;
     23    uint32  r14;
     24    uint32  r15;
     25    uint32  pc;
     26    uint32  lr;
     27#warning ARM: missing members!
     28    uint32  cspr;
     29} __attribute__((aligned(8)));
     30
     31#endif  // _ARCH_M68K_DEBUGGER_H
  • headers/posix/arch/arm/signal.h

     
     1
    12/*
    23 * Copyright 2008, Haiku, Inc. All Rights Reserved.
    34 * Distributed under the terms of the MIT License.
     
    2829    ulong r13;  /* stack pointer */
    2930    ulong r14;  /* link register */
    3031    ulong r15;  /* program counter */
    31     ulong cpsr;
    32 #warning ARM: fix floats in vregs, add missing stuff.
     32    ulong cpsr;     /* current programm status register */
     33//#warning ARM: fix add missing stuff.
    3334};
    3435#endif /* __ARM__ */
    3536
  • headers/posix/arch/arm/arch_setjmp.h

     
    55#ifndef _ARCH_SETJMP_H_
    66#define _ARCH_SETJMP_H_
    77
    8 #define _SETJMP_BUF_SZ (7+6+2+8*((96/8)/4))
    9 typedef int __jmp_buf[_SETJMP_BUF_SZ];
    10 #warning ARM: fix jmpbuf size
     8//#define _SETJMP_BUF_SZ (7+6+2+8*((96/8)/4))
     9typedef int __jmp_buf[64];
     10//#warning ARM: fix jmpbuf size
    1111
    1212#endif  /* _ARCH_SETJMP_H_ */
  • headers/posix/setjmp.h

     
    1414    #include <arch/ppc/arch_setjmp.h>
    1515#elif __M68K__
    1616    #include <arch/m68k/arch_setjmp.h>
     17#elif __ARM__
     18    #include <arch/arm/arch_setjmp.h>
    1719#else
    1820    #error #include <arch/<cpu>/arch_setjmp.h>
    1921#endif
  • headers/posix/signal.h

     
    257257        #include <arch/ppc/signal.h>
    258258#elif __M68K__
    259259        #include <arch/m68k/signal.h>
     260#elif __ARM__
     261        #include <arch/arm/signal.h>
    260262#else
    261263        #error #include <arch/<cpu>/signal.h>
    262264#endif
  • headers/private/kernel/arch/arm/arch_kernel_args.h

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5#ifndef KERNEL_ARCH_M68K_KERNEL_ARGS_H
     6#define KERNEL_ARCH_M68K_KERNEL_ARGS_H
     7
     8#ifndef KERNEL_BOOT_KERNEL_ARGS_H
     9#   error This file is included from <boot/kernel_args.h> only
     10#endif
     11
     12#define _PACKED __attribute__((packed))
     13
     14//#define MAX_VIRTUAL_RANGES_TO_KEEP    32
     15
     16// kernel args
     17typedef struct {
     18    int         cpu_type; // decimal: 68030, ...
     19    int         fpu_type; // decimal: 68030, ...
     20    int         mmu_type; // decimal: 68030, ...
     21    int         platform; // M68K_PLATFORM_*
     22    int         machine;  // platform specific machine type
     23    bool            has_lpstop; //XXX: use bit flags
     24    // architecture specific
     25    uint64      cpu_frequency;
     26    uint64      bus_frequency;
     27    uint64      time_base_frequency;
     28
     29    // page root table
     30    uint32  phys_pgroot;
     31    uint32  vir_pgroot;
     32    // interrupt vector table (VBR)
     33    uint32  phys_vbr;
     34    uint32  vir_vbr;
     35//XXX:
     36    addr_range  page_table;     // virtual address and size of the page table
     37    addr_range  exception_handlers;
     38    addr_range  framebuffer;        // maps where the framebuffer is located, in physical memory
     39    int         screen_x, screen_y, screen_depth;
     40
     41    // The virtual ranges we want to keep in the kernel. E.g. those belonging
     42    // to the Open Firmware.
     43//  uint32      num_virtual_ranges_to_keep;
     44//  addr_range  virtual_ranges_to_keep[MAX_VIRTUAL_RANGES_TO_KEEP];
     45
     46    // platform specific
     47    union {
     48        struct {
     49            struct {
     50                //XXX: are those meant to be used by physical
     51                // or virtual address ?
     52                uint32 (*nf_get_id)(const char *);
     53                int32 (*nf_call)(uint32, ...);
     54                addr_t nf_page;
     55                uint32 nf_dprintf_id;
     56            } nat_feat;
     57        } atari;
     58    } plat_args;
     59} arch_kernel_args;
     60
     61#endif  /* KERNEL_ARCH_M68K_KERNEL_ARGS_H */
  • headers/private/kernel/arch/arm/arch_vm_translation_map.h

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5#ifndef _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H
     6#define _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H
     7
     8#include <arch/vm_translation_map.h>
     9
     10#ifdef __cplusplus
     11extern "C" {
     12#endif
     13
     14void m68k_translation_map_change_asid(vm_translation_map *map);
     15
     16status_t m68k_map_address_range(addr_t virtualAddress, addr_t physicalAddress,
     17    size_t size);
     18void m68k_unmap_address_range(addr_t virtualAddress, size_t size);
     19status_t m68k_remap_address_range(addr_t *virtualAddress, size_t size,
     20    bool unmap);
     21
     22#ifdef __cplusplus
     23}
     24#endif
     25
     26#endif /* _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H */
  • headers/private/kernel/arch/arm/arch_mmu.h

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5#ifndef _KERNEL_ARCH_M68K_MMU_H
     6#define _KERNEL_ARCH_M68K_MMU_H
     7
     8
     9#include <SupportDefs.h>
     10#include <string.h>
     11
     12
     13/*
     14 * cf.
     15 * "mc68030 Enhanced 32-bit Microprocessor User's Manual"
     16 * (3rd edition), Section 9
     17 * "mc68040 Enhanced 32-bit Microprocessor User's Manual"
     18 * Section 9
     19 *
     20 * The 030 pmmu can support up to 6-level translation tree,
     21 * each level using an size-selectable index from the
     22 * virtual address, short (4-bit) and long (8-bit) page table
     23 * and page entry descriptors, early tree termination, and selectable
     24 * page size from 256 bytes to 32K.
     25 * There is optionally a separate Supervisor Root Pointer to separate
     26 * the user and kernel trees.
     27 *
     28 * The 040 pmmu however is way more limited in its abilities.
     29 * It has a fixed 3-level page tree, with 7/7/6 bit splitting for
     30 * 4K pages. The opcodes are also different so we will need specific
     31 * routines. Both supervisor and root pointers must be used so we can't
     32 * reuse one of them.
     33 *
     34 *
     35 * We settle to:
     36 * - 1 bit index for the first level to easily split kernel and user
     37 * part of the tree, with the possibility to force supervisor only for
     38 * the kernel tree. The use of SRP to point to a 2nd tree is avoided as
     39 * it is not available on 68060, plus that makes a spare 64bit reg to
     40 * stuff things in.
     41 * - 9 bit page directory
     42 * - 10 bit page tables
     43 * - 12 bit page index (4K pages, a common value).
     44 */
     45
     46
     47
     48enum descriptor_types {
     49    DT_INVALID = 0,         // invalid entry
     50    DT_PAGE,                // page descriptor
     51    DT_VALID_4,             // short page table descriptor
     52    DT_VALID_8,             // long page table descriptor
     53};
     54
     55#if 0
     56/* This is the normal layout of the descriptors, as per documentation.
     57 * When page size > 256, several bits are unused in the LSB of page
     58 * addresses, which we can use in addition of other unused bits.
     59 * the structs dedlared later reflect this for 4K pages.
     60 */
     61
     62struct short_page_directory_entry {
     63    // upper 32 bits
     64    uint32 type : 2;
     65    uint32 write_protect : 1;
     66    uint32 used : 1;
     67    uint32 address : 28;
     68};
     69
     70struct long_page_directory_entry {
     71    // upper 32 bits
     72    uint32 type : 2;
     73    uint32 write_protect : 1;
     74    uint32 used : 1;
     75    uint32 _zero1 : 4;
     76    uint32 supervisor : 1;
     77    uint32 _zero2 : 1;
     78    uint32 _ones : 6;
     79    uint32 limit : 15;
     80    uint32 low_up : 1;                      // limit is lower(1)/upper(0)
     81    // lower 32 bits
     82    uint32 unused : 4;                      //
     83    uint32 address : 28;
     84};
     85
     86struct short_page_table_entry {
     87    uint32 type : 2;
     88    uint32 write_protect : 1;
     89    uint32 used : 1;
     90    uint32 modified : 1;
     91    uint32 _zero1 : 1;
     92    uint32 cache_inhibit : 1;
     93    uint32 _zero2 : 1;
     94    uint32 address : 24;
     95};
     96
     97struct long_page_table_entry {
     98    // upper 32 bits
     99    uint32 type : 2;
     100    uint32 write_protect : 1;
     101    uint32 used : 1;
     102    uint32 modified : 1;
     103    uint32 _zero1 : 1;
     104    uint32 cache_inhibit : 1;
     105    uint32 _zero2 : 1;
     106    uint32 supervisor : 1;
     107    uint32 _zero3 : 1;
     108    uint32 _ones : 6;
     109    // limit only used on early table terminators, else unused
     110    uint32 limit : 15;
     111    uint32 low_up : 1;                      // limit is lower(1)/upper(0)
     112    // lower 32 bits
     113    uint32 unused : 8;                      //
     114    uint32 address : 24;
     115};
     116#endif
     117
     118/* ppc
     119extern void m68k_get_page_table(page_table_entry_group **_pageTable, size_t *_size);
     120extern void m68k_set_page_table(page_table_entry_group *pageTable, size_t size);
     121*/
     122
     123#endif  /* _KERNEL_ARCH_M68K_MMU_H */
  • headers/private/kernel/arch/arm/arch_system_info.h

     
     1/*
     2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _KERNEL_ARCH_M68K_SYSTEM_INFO_H
     6#define _KERNEL_ARCH_M68K_SYSTEM_INFO_H
     7
     8
     9/* nothing to be seen here yet */
     10
     11
     12#endif  /* _KRENEL_ARCH_M68K_SYSTEM_INFO_H */
  • headers/private/kernel/arch/arm/arch_vm_types.h

     
     1/*
     2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _KERNEL_ARCH_M68K_VM_TYPES_H
     6#define _KERNEL_ARCH_M68K_VM_TYPES_H
     7
     8#endif  /* _KERNEL_ARCH_M68K_VM_TYPES_H */
  • headers/private/kernel/arch/arm/arch_thread.h

     
     1/*
     2 * Copyright 2003-2006, Haiku Inc. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 *
     5 * Authors:
     6 *      Axel Dörfler <axeld@pinc-software.de>
     7 *      Ingo Weinhold <bonefish@cs.tu-berlin.de>
     8 */
     9#ifndef _KERNEL_ARCH_M68K_THREAD_H
     10#define _KERNEL_ARCH_M68K_THREAD_H
     11
     12#include <arch/cpu.h>
     13
     14#ifdef __cplusplus
     15extern "C" {
     16#endif
     17
     18void m68k_push_iframe(struct iframe_stack *stack, struct iframe *frame);
     19void m68k_pop_iframe(struct iframe_stack *stack);
     20struct iframe *m68k_get_user_iframe(void);
     21
     22/* as we won't support SMP on m68k (yet?) we can use a global here */
     23extern struct thread *gCurrentThread;
     24
     25extern inline struct thread *
     26arch_thread_get_current_thread(void)
     27{
     28    return gCurrentThread;
     29}
     30
     31
     32extern inline void
     33arch_thread_set_current_thread(struct thread *t)
     34{
     35    gCurrentThread = t;
     36}
     37
     38#if 0
     39/* this would only work on 030... */
     40
     41extern inline struct thread *
     42arch_thread_get_current_thread(void)
     43{
     44    uint64 v = 0;
     45    asm volatile("pmove %%srp,(%0)" : : "a"(&v));
     46    return (struct thread *)(uint32)(v & 0xffffffff);
     47}
     48
     49
     50extern inline void
     51arch_thread_set_current_thread(struct thread *t)
     52{
     53    uint64 v;
     54    asm volatile("pmove %%srp,(%0)\n" \
     55            "move %1,(4,%0)\n" \
     56            "pmove (%0),%%srp" : : "a"(&v), "d"(t));
     57}
     58#endif
     59
     60#ifdef __cplusplus
     61}
     62#endif
     63
     64
     65#endif /* _KERNEL_ARCH_M68K_THREAD_H */
  • headers/private/kernel/arch/arm/types.h

     
     1/*
     2** Copyright 2001, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef _M68K_TYPES_H
     6#define _M68K_TYPES_H
     7 
     8typedef unsigned long long  uint64;
     9typedef long long            int64;
     10typedef unsigned int       uint32;
     11typedef int                 int32;
     12typedef unsigned short     uint16;
     13typedef short               int16;
     14typedef unsigned char      uint8;
     15typedef char                int8;
     16
     17#endif
     18
  • headers/private/kernel/arch/arm/arch_kernel.h

     
     1/*
     2** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef _KERNEL_ARCH_M68K_KERNEL_H
     6#define _KERNEL_ARCH_M68K_KERNEL_H
     7
     8#include <arch/cpu.h>
     9
     10// memory layout
     11#define KERNEL_BASE 0x80000000
     12#define KERNEL_SIZE 0x80000000
     13#define KERNEL_TOP  (KERNEL_BASE + (KERNEL_SIZE - 1))
     14
     15/*
     16** User space layout is a little special:
     17** The user space does not completely cover the space not covered by the kernel.
     18** This is accomplished by starting user space at 1Mb and running to 64kb short of kernel space.
     19** The lower 1Mb reserved spot makes it easy to find null pointer references and guarantees a
     20** region wont be placed there. The 64kb region assures a user space thread cannot pass
     21** a buffer into the kernel as part of a syscall that would cross into kernel space.
     22*/
     23#define USER_BASE     0x100000
     24#define USER_BASE_ANY USER_BASE
     25#define USER_SIZE     (0x80000000 - (0x10000 + 0x100000))
     26#define USER_TOP      (USER_BASE + USER_SIZE)
     27
     28#define KERNEL_USER_DATA_BASE  0x6fff0000
     29#define USER_STACK_REGION              0x70000000
     30#define USER_STACK_REGION_SIZE (USER_TOP - USER_STACK_REGION)
     31
     32#endif  /* _KERNEL_ARCH_M68K_KERNEL_H */
  • headers/private/kernel/arch/arm/ktypes.h

     
     1/*
     2** Copyright 2001, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef _M68K_KTYPES_H
     6#define _M68K_KTYPES_H
     7
     8typedef unsigned long addr;
     9
     10#endif
     11
  • headers/private/kernel/arch/arm/arch_user_debugger.h

     
     1/*
     2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _KERNEL_ARCH_M68K_USER_DEBUGGER_H
     6#define _KERNEL_ARCH_M68K_USER_DEBUGGER_H
     7
     8
     9struct arch_team_debug_info {
     10    uint32 dummy;
     11};
     12
     13struct arch_thread_debug_info {
     14    uint32 dummy;
     15};
     16
     17#endif  // _KERNEL_ARCH_M68K_USER_DEBUGGER_H
  • headers/private/kernel/arch/arm/arch_vm.h

     
     1/*
     2 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef ARCH_M68K_VM_H
     6#define ARCH_M68K_VM_H
     7
     8#include <vm_translation_map.h>
     9
     10/* This many pages will be read/written on I/O if possible */
     11
     12#define NUM_IO_PAGES    4
     13    /* 16 kB */
     14
     15#define PAGE_SHIFT 12
     16
     17
     18struct m68k_vm_ops {
     19    void *(*m68k_translation_map_get_pgdir)(vm_translation_map *map);
     20    status_t (*arch_vm_translation_map_init_map)(vm_translation_map *map, bool kernel);
     21    status_t (*arch_vm_translation_map_init_kernel_map_post_sem)(vm_translation_map *map);
     22    status_t (*arch_vm_translation_map_init)(kernel_args *args);
     23    status_t (*arch_vm_translation_map_init_post_area)(kernel_args *args);
     24    status_t (*arch_vm_translation_map_init_post_sem)(kernel_args *args);
     25    status_t (*arch_vm_translation_map_early_map)(kernel_args *ka, addr_t virtualAddress, addr_t physicalAddress,
     26        uint8 attributes, addr_t (*get_free_page)(kernel_args *));
     27    status_t (*arch_vm_translation_map_early_query)(addr_t va, addr_t *out_physical);
     28    void (*m68k_set_pgdir)(void *);
     29#if 0 /* ppc stuff only ? */
     30    status_t (*m68k_map_address_range)(addr_t virtualAddress, addr_t physicalAddress,
     31        size_t size);
     32    void (*m68k_unmap_address_range)(addr_t virtualAddress, size_t size);
     33    status_t (*m68k_remap_address_range)(addr_t *_virtualAddress, size_t size, bool unmap);
     34#endif
     35};
     36
     37#ifdef __cplusplus
     38extern "C" {
     39#endif
     40
     41extern struct m68k_vm_ops *get_vm_ops();
     42
     43extern void *m68k_translation_map_get_pgdir(vm_translation_map *map);
     44extern void m68k_set_pgdir(void *rt);
     45
     46#ifdef __cplusplus
     47}
     48#endif
     49
     50#endif  /* ARCH_M68K_VM_H */
  • headers/private/kernel/arch/arm/arch_platform.h

     
     1/*
     2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
     3 * All rights reserved. Distributed under the terms of the MIT License.
     4 */
     5#ifndef _KERNEL_ARM_ARCH_PLATFORM_H
     6#define _KERNEL_ARM_ARCH_PLATFORM_H
     7
     8#include <OS.h>
     9#include <arch/platform.h>
     10
     11struct real_time_data;
     12
     13typedef enum ARM_platform_types {
     14    ARM_PLATFORM_BEAGLEBOARD = 0,
     15} ARM_platform_type;
     16
     17namespace BPrivate {
     18
     19// implemented in src/system/kernel/arch/ARM/arch_platform.cpp
     20
     21class ARMPlatform {
     22public:
     23    ARMPlatform(platform_type platformType, ARM_platform_type ARMPlatformType);
     24    virtual ~ARMPlatform();
     25
     26    static ARMPlatform *Default();
     27
     28    inline platform_type PlatformType() const   { return fPlatformType; }
     29    inline ARM_platform_type ARMPlatformType() const    { return fARMPlatformType; }
     30
     31    virtual status_t Init(struct kernel_args *kernelArgs) = 0;
     32    virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
     33    virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
     34    virtual status_t InitPIC(struct kernel_args *kernelArgs) = 0;
     35    virtual status_t InitRTC(struct kernel_args *kernelArgs,
     36        struct real_time_data *data) = 0;
     37    virtual status_t InitTimer(struct kernel_args *kernelArgs) = 0;
     38
     39    virtual char BlueScreenGetChar() = 0;
     40
     41    virtual char SerialDebugGetChar() = 0;
     42    virtual void SerialDebugPutChar(char c) = 0;
     43
     44    virtual void EnableIOInterrupt(int irq) = 0;
     45    virtual void DisableIOInterrupt(int irq) = 0;
     46    virtual bool AcknowledgeIOInterrupt(int irq) = 0;
     47
     48    // mimic the PC CMOS
     49    virtual uint8 ReadRTCReg(uint8 reg) = 0;
     50    virtual void WriteRTCReg(uint8 reg, uint8 val) = 0;
     51    virtual void SetHardwareRTC(uint32 seconds) = 0;
     52    virtual uint32 GetHardwareRTC() = 0;
     53
     54    virtual void SetHardwareTimer(bigtime_t timeout) = 0;
     55    virtual void ClearHardwareTimer(void) = 0;
     56
     57    virtual void ShutDown(bool reboot) = 0;
     58
     59private:
     60    ARM_platform_type   fARMPlatformType;
     61    platform_type   fPlatformType;
     62};
     63
     64
     65}   // namespace BPrivate
     66
     67using BPrivate::ARMPlatform;
     68
     69//extern "C" ARMPlatform *instanciate_ARM_platform_amiga();
     70extern "C" ARMPlatform *instanciate_ARM_platform_beagleboard();
     71//extern "C" ARMPlatform *instanciate_ARM_platform_mac();
     72//extern "C" ARMPlatform *instanciate_ARM_platform_next();
     73
     74
     75#endif  // _KERNEL_ARM_ARCH_PLATFORM_H
  • headers/private/kernel/arch/arm/arch_cpu.h

     
     1/*
     2** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the Haiku License.
     4*/
     5#ifndef _KERNEL_ARCH_M68K_CPU_H
     6#define _KERNEL_ARCH_M68K_CPU_H
     7
     8#ifndef _ASSEMBLER
     9
     10#include <arch/arm/arch_thread_types.h>
     11#include <kernel.h>
     12
     13#endif  // !_ASSEMBLER
     14
     15/*
     16#define SR_IP_MASK 0x0700
     17#define SR_S 0x2000
     18#define M68K_SR_S 13
     19#define M68K_SR_T_MASK 0xC000
     20#define M68K_SR_T0 14
     21#define M68K_SR_T1 15
     22*/
     23#ifndef _ASSEMBLER
     24
     25
     26
     27
     28
     29#warning M68K: check for missing regs/movem
     30struct iframe {
     31
     32#warning "iframe is nonsense"
     33    /* fpu data registers */
     34//#warning M68K: sizeof(fp*)
     35//  struct mc680x0_fp_data_reg fp[8];
     36    /* fpu control registers */
     37//  struct mc680x0_fp_control_regs fpc;
     38    /* fpu state */
     39//  struct mc680x0_fpu_state fpu;
     40   
     41    /* data and address registers */
     42//  uint32 d[8];
     43//  uint32 a[7];
     44    /* cpu exception frame, including sr, pc, format and vector */
     45//  struct mc680x0_frame cpu;
     46
     47/*  uint32 vector;
     48    uint32 srr0;
     49    uint32 srr1;
     50    uint32 dar;
     51    uint32 dsisr;
     52    uint32 lr;
     53    uint32 cr;
     54    uint32 xer;
     55    uint32 ctr;
     56    uint32 fpscr;
     57    uint32 r31;
     58    uint32 r30;
     59    uint32 r29;
     60    uint32 r28;
     61    uint32 r27;
     62    uint32 r26;
     63    uint32 r25;
     64    uint32 r24;
     65    uint32 r23;
     66    uint32 r22;
     67    uint32 r21;
     68    uint32 r20;
     69    uint32 r19;
     70    uint32 r18;
     71    uint32 r17;
     72    uint32 r16;
     73    uint32 r15;
     74    uint32 r14;
     75    uint32 r13;
     76    uint32 r12;
     77    uint32 r11;
     78    uint32 r10;
     79    uint32 r9;
     80    uint32 r8;
     81    uint32 r7;
     82    uint32 r6;
     83    uint32 r5;
     84    uint32 r4;
     85    uint32 r3;
     86    uint32 r2;
     87    uint32 r1;
     88    uint32 r0;
     89    double f31;
     90    double f30;
     91    double f29;
     92    double f28;
     93    double f27;
     94    double f26;
     95    double f25;
     96    double f24;
     97    double f23;
     98    double f22;
     99    double f21;
     100    double f20;
     101    double f19;
     102    double f18;
     103    double f17;
     104    double f16;
     105    double f15;
     106    double f14;
     107    double f13;
     108    double f12;
     109    double f11;
     110    double f10;
     111    double f9;
     112    double f8;
     113    double f7;
     114    double f6;
     115    double f5;
     116    double f4;
     117    double f3;
     118    double f2;
     119    double f1;
     120    double f0;*/
     121} _PACKED;
     122
     123
     124typedef struct arch_cpu_info {
     125    int null;
     126} arch_cpu_info;
     127
     128
     129#ifdef __cplusplus
     130extern "C" {
     131#endif
     132
     133//extern long long get_time_base(void);
     134
     135//void __m68k_setup_system_time(vint32 *cvFactor);
     136    // defined in libroot: os/arch/system_time.c
     137//int64 __m68k_get_time_base(void);
     138    // defined in libroot: os/arch/system_time_asm.S
     139/*
     140extern void m68k_context_switch(void **_oldStackPointer, void *newStackPointer);
     141
     142extern bool m68k_set_fault_handler(addr_t *handlerLocation, addr_t handler)
     143    __attribute__((noinline));
     144
     145extern bool m68k_is_hw_register_readable(addr_t address);
     146extern bool m68k_is_hw_register_writable(addr_t address, uint16 value);
     147    // defined in kernel: arch/m68k/cpu_asm.S
     148*/
     149#ifdef __cplusplus
     150}
     151#endif
     152
     153struct m68k_cpu_ops {
     154    void (*flush_insn_pipeline)(void);
     155    void (*flush_atc_all)(void);
     156    void (*flush_atc_user)(void);
     157    void (*flush_atc_addr)(addr_t addr);
     158    void (*flush_dcache)(addr_t address, size_t len);
     159    void (*flush_icache)(addr_t address, size_t len);
     160    void (*idle)(void);
     161};
     162
     163
     164extern int arch_cpu_type;
     165extern int arch_fpu_type;
     166extern int arch_mmu_type;
     167extern int arch_platform;
     168extern int arch_machine;
     169
     170/*
     171    Use of (some) special purpose registers.
     172    XXX: those regs aren't implemented/accessed the same way on different cpus...
     173
     174    SRP[63-32]: current struct thread*
     175    SRP[31-0] :
     176    CAAR      : can we use it ??
     177    MSP       :
     178
     179    PPC:
     180    SPRG0: per CPU physical address pointer to an ppc_cpu_exception_context
     181           structure
     182    SPRG1: scratch
     183    SPRG2: current struct thread*
     184    SPRG3: TLS base pointer (only for userland threads)
     185*/
     186
     187#endif  // !_ASSEMBLER
     188
     189#endif  /* _KERNEL_ARCH_PPC_CPU_H */
  • headers/private/kernel/arch/arm/stage2_priv.h

     
     1/*
     2** Copyright 2001, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef _STAGE2_PRIV_H
     6#define _STAGE2_PRIV_H
     7
     8#define LOAD_ADDR 0x100000
     9#define BOOTDIR_ADDR 0x101000
     10
     11int s2_text_init();
     12void s2_change_framebuffer_addr(unsigned int address);
     13void putchar(char c);
     14void puts(char *str);
     15int printf(const char *fmt, ...);
     16
     17int of_init(void *of_entry);
     18int of_open(const char *node_name);
     19int of_finddevice(const char *dev);
     20int of_instance_to_package(int in_handle);
     21int of_getprop(int handle, const char *prop, void *buf, int buf_len);
     22int of_setprop(int handle, const char *prop, const void *buf, int buf_len);
     23int of_read(int handle, void *buf, int buf_len);
     24int of_write(int handle, void *buf, int buf_len);
     25int of_seek(int handle, long long pos);
     26
     27int s2_mmu_init();
     28void mmu_map_page(unsigned int vsid, unsigned long pa, unsigned long va);;
     29void syncicache(void *address, int len);
     30
     31void s2_faults_init(kernel_args *ka);
     32
     33void getibats(int bats[8]);
     34void setibats(int bats[8]);
     35void getdbats(int bats[8]);
     36void setdbats(int bats[8]);
     37unsigned int *getsdr1();
     38void setsdr1(unsigned int sdr);
     39unsigned int getsr(int sr);
     40unsigned int getmsr();
     41void setmsr(unsigned int msr);
     42
     43#endif
  • headers/private/kernel/arch/arm/arch_int.h

     
     1/*
     2 * Copyright 2005-2006, Haiku Inc. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 *
     5 * Authors:
     6 *      Axel Dörfler <axeld@pinc-software.de>
     7 *      Ingo Weinhold <bonefish@cs.tu-berlin.de>
     8 */
     9#ifndef _KERNEL_ARCH_ARM_INT_H
     10#define _KERNEL_ARCH_ARM_INT_H
     11
     12#include <SupportDefs.h>
     13
     14#define NUM_IO_VECTORS  256
     15
     16#endif /* _KERNEL_ARCH_M68K_INT_H */
  • headers/private/kernel/arch/arm/cpu.h

     
     1/*
     2** Copyright 2001, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef _ARM_CPU_H
     6#define _ARM_CPU_H
     7
     8#define PAGE_SIZE 4096
     9
     10#endif
     11
  • headers/private/kernel/arch/arm/arch_thread_types.h

     
     1/*
     2** Copyright 2001, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5#ifndef KERNEL_ARCH_M68K_THREAD_TYPES_H
     6#define KERNEL_ARCH_M68K_THREAD_TYPES_H
     7
     8#include <kernel.h>
     9
     10#define IFRAME_TRACE_DEPTH 4
     11
     12struct iframe_stack {
     13    struct iframe *frames[IFRAME_TRACE_DEPTH];
     14    int32   index;
     15};
     16
     17// architecture specific thread info
     18struct arch_thread {
     19    void    *sp;    // stack pointer
     20    void    *interrupt_stack;
     21
     22    // used to track interrupts on this thread
     23    struct iframe_stack iframes;
     24};
     25
     26struct arch_team {
     27    // gcc treats empty structures as zero-length in C, but as if they contain
     28    // a char in C++. So we have to put a dummy in to be able to use the struct
     29    // from both in a consistent way.
     30    char    dummy;
     31};
     32
     33struct arch_fork_arg {
     34    // gcc treats empty structures as zero-length in C, but as if they contain
     35    // a char in C++. So we have to put a dummy in to be able to use the struct
     36    // from both in a consistent way.
     37    char    dummy;
     38};
     39
     40#endif  /* KERNEL_ARCH_M68K_THREAD_TYPES_H */
  • headers/private/system/arch/arm/asm_defs.h

     
     1/*
     2 * Copyright 2008, François Revol, revol@free.fr.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef SYSTEM_ARCH_ARM_ASM_DEFS_H
     6#define SYSTEM_ARCH_ARM_ASM_DEFS_H
     7
     8
     9#define SYMBOL(name)            .global name; name
     10#define SYMBOL_END(name)        1: .size name, 1b - name
     11#define STATIC_FUNCTION(name)   .type name, @function; name
     12#define FUNCTION(name)          .global name; .type name, %function; name
     13#define FUNCTION_END(name)      1: .size name, 1b - name
     14
     15
     16#endif  /* SYSTEM_ARCH_ARM_ASM_DEFS_H */
     17
  • headers/private/system/arch/arm/arch_config.h

     
     1
     2/*
     3 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de.
     4 * Distributed under the terms of the MIT License.
     5 */
     6#ifndef _KERNEL_ARCH_ARM_CONFIG_H
     7#define _KERNEL_ARCH_ARM_CONFIG_H
     8
     9
     10#define FUNCTION_CALL_PARAMETER_ALIGNMENT_TYPE  unsigned int
     11
     12#define STACK_GROWS_DOWNWARDS
     13
     14//#define ATOMIC_FUNCS_ARE_SYSCALLS
     15//#define ATOMIC64_FUNCS_ARE_SYSCALLS
     16
     17
     18#endif  /* _KERNEL_ARCH_M68K_CONFIG_H */
  • headers/private/system/arch/arm/arch_elf.h

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5#ifndef _KERNEL_ARCH_M68K_ELF_H
     6#define _KERNEL_ARCH_M68K_ELF_H
     7
     8/* relocation types */
     9
     10#define R_68K_NONE              0
     11#define R_68K_32 1            /* Direct 32 bit  */
     12#define R_68K_16 2            /* Direct 16 bit  */
     13#define R_68K_8 3             /* Direct 8 bit  */
     14#define R_68K_PC32 4          /* PC relative 32 bit */
     15#define R_68K_PC16 5          /* PC relative 16 bit */
     16#define R_68K_PC8 6           /* PC relative 8 bit */
     17#define R_68K_GOT32 7         /* 32 bit PC relative GOT entry */
     18#define R_68K_GOT16 8         /* 16 bit PC relative GOT entry */
     19#define R_68K_GOT8 9          /* 8 bit PC relative GOT entry */
     20#define R_68K_GOT32O 10       /* 32 bit GOT offset */
     21#define R_68K_GOT16O 11       /* 16 bit GOT offset */
     22#define R_68K_GOT8O 12        /* 8 bit GOT offset */
     23#define R_68K_PLT32 13        /* 32 bit PC relative PLT address */
     24#define R_68K_PLT16 14        /* 16 bit PC relative PLT address */
     25#define R_68K_PLT8 15         /* 8 bit PC relative PLT address */
     26#define R_68K_PLT32O 16       /* 32 bit PLT offset */
     27#define R_68K_PLT16O 17       /* 16 bit PLT offset */
     28#define R_68K_PLT8O 18        /* 8 bit PLT offset */
     29#define R_68K_COPY 19         /* Copy symbol at runtime */
     30#define R_68K_GLOB_DAT 20     /* Create GOT entry */
     31#define R_68K_JMP_SLOT 21     /* Create PLT entry */
     32#define R_68K_RELATIVE 22     /* Adjust by program base */
     33/* These are GNU extensions to enable C++ vtable garbage collection.  */
     34#define R_68K_GNU_VTINHERIT 23
     35#define R_68K_GNU_VTENTRY 24
     36
     37#endif  /* _KERNEL_ARCH_M68K_ELF_H */
  • headers/private/system/arch/arm/arch_commpage_defs.h

     
     1/*
     2 * Copyright 2007, Travis Geiselbrecht. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _SYSTEM_ARCH_ARM_COMMPAGE_DEFS_H
     6#define _SYSTEM_ARCH_ARM_COMMPAGE_DEFS_H
     7
     8#ifndef _SYSTEM_COMMPAGE_DEFS_H
     9#   error Must not be included directly. Include <commpage_defs.h> instead!
     10#endif
     11
     12#define COMMPAGE_ENTRY_ARM_SYSCALL  (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
     13#define COMMPAGE_ENTRY_ARM_MEMCPY   (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
     14
     15/* 0xffff0000 colides with IO space mapped with TT1 on Atari */
     16#define ARCH_USER_COMMPAGE_ADDR (0xfeff0000)
     17
     18#endif  /* _SYSTEM_ARCH_M68K_COMMPAGE_DEFS_H */
  • headers/private/system/arch/arm/arch_real_time_data.h

     
     1/*
     2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
     3 * All rights reserved. Distributed under the terms of the MIT License.
     4 */
     5#ifndef _KERNEL_ARCH_REAL_TIME_DATA_H
     6#define _KERNEL_ARCH_REAL_TIME_DATA_H
     7
     8#include <StorageDefs.h>
     9#include <SupportDefs.h>
     10
     11#warning ARM: fix system_time()
     12
     13struct arch_real_time_data {
     14    vint32                      system_time_conversion_factor;
     15    vint32                      version;
     16        // Since there're no cheap atomic_{set,get,add}64() on PPC 32 (i.e. one
     17        // that doesn't involve a syscall), we can't have just a single
     18        // system_time_offset and set/get it atomically.
     19        // That's why have our data twice. One set is current (indexed by
     20        // version % 2). When setting the offset, we do that with disabled
     21        // interrupts and protected by a spinlock. We write the new values
     22        // into the other array element and increment the version.
     23        // A reader first reads the version, then the date of interest, and
     24        // finally rechecks the version. If it hasn't changed in the meantime,
     25        // the read value is fine, otherwise it runs the whole procedure again.
     26        //
     27        // system_time_conversion_factor is currently consider constant,
     28        // although that is not necessarily true. We simply don't support
     29        // changing conversion factors at the moment.
     30};
     31
     32#endif  /* _KERNEL_ARCH_REAL_TIME_DATA_H */