Home | History | Annotate | Line # | Download | only in arm32
machdep.h revision 1.21.12.3
      1  1.21.12.3  pgoyette /* $NetBSD: machdep.h,v 1.21.12.3 2018/10/20 06:58:25 pgoyette Exp $ */
      2        1.1     chris 
      3  1.21.12.2  pgoyette #ifndef _ARM32_MACHDEP_H_
      4  1.21.12.2  pgoyette #define _ARM32_MACHDEP_H_
      5        1.1     chris 
      6       1.20     skrll /* Define various stack sizes in pages */
      7       1.11      matt #ifndef IRQ_STACK_SIZE
      8       1.11      matt #define IRQ_STACK_SIZE	1
      9       1.11      matt #endif
     10       1.11      matt #ifndef ABT_STACK_SIZE
     11       1.11      matt #define ABT_STACK_SIZE	1
     12       1.11      matt #endif
     13       1.11      matt #ifndef UND_STACK_SIZE
     14       1.11      matt #define UND_STACK_SIZE	1
     15       1.11      matt #endif
     16       1.11      matt #ifndef FIQ_STACK_SIZE
     17       1.11      matt #define FIQ_STACK_SIZE	1
     18       1.11      matt #endif
     19       1.11      matt 
     20       1.11      matt extern void (*cpu_reset_address)(void);
     21       1.11      matt extern paddr_t cpu_reset_address_paddr;
     22       1.11      matt 
     23       1.19  jmcneill extern void (*cpu_powerdown_address)(void);
     24       1.19  jmcneill 
     25       1.10      matt extern u_int data_abort_handler_address;
     26       1.10      matt extern u_int prefetch_abort_handler_address;
     27       1.14      matt // extern u_int undefined_handler_address;
     28       1.14      matt #define	undefined_handler_address (curcpu()->ci_undefsave[2])
     29       1.14      matt 
     30       1.14      matt struct bootmem_info {
     31       1.14      matt 	paddr_t bmi_start;
     32       1.14      matt 	paddr_t bmi_kernelstart;
     33       1.14      matt 	paddr_t bmi_kernelend;
     34       1.14      matt 	paddr_t bmi_end;
     35       1.14      matt 	pv_addrqh_t bmi_freechunks;
     36       1.14      matt 	pv_addrqh_t bmi_chunks;		/* sorted list of memory to be mapped */
     37       1.14      matt 	pv_addr_t bmi_freeblocks[4];
     38       1.14      matt 	/*
     39       1.14      matt 	 * These need to be static for pmap's kernel_pt list.
     40       1.14      matt 	 */
     41       1.14      matt 	pv_addr_t bmi_vector_l2pt;
     42       1.14      matt 	pv_addr_t bmi_io_l2pt;
     43       1.17      matt 	pv_addr_t bmi_l2pts[32];	// for large memory disks.
     44       1.14      matt 	u_int bmi_freepages;
     45       1.14      matt 	u_int bmi_nfreeblocks;
     46       1.14      matt };
     47       1.14      matt 
     48       1.14      matt extern struct bootmem_info bootmem_info;
     49       1.10      matt 
     50       1.10      matt extern char *booted_kernel;
     51       1.10      matt 
     52       1.14      matt extern volatile uint32_t arm_cpu_hatched;
     53       1.18      matt extern volatile uint32_t arm_cpu_mbox;
     54       1.14      matt extern u_int arm_cpu_max;
     55  1.21.12.2  pgoyette extern u_long kern_vtopdiff;
     56  1.21.12.2  pgoyette 
     57       1.14      matt 
     58        1.1     chris /* misc prototypes used by the many arm machdeps */
     59       1.12      matt void cortex_pmc_ccnt_init(void);
     60       1.14      matt void cpu_hatch(struct cpu_info *, cpuid_t, void (*)(struct cpu_info *));
     61        1.9       dsl void halt(void);
     62        1.9       dsl void parse_mi_bootargs(char *);
     63        1.9       dsl void data_abort_handler(trapframe_t *);
     64        1.9       dsl void prefetch_abort_handler(trapframe_t *);
     65        1.9       dsl void undefinedinstruction_bounce(trapframe_t *);
     66        1.9       dsl void dumpsys(void);
     67        1.1     chris 
     68       1.20     skrll /*
     69       1.21     skrll  * note that we use void * as all the platforms have different ideas on what
     70        1.2     chris  * the structure is
     71        1.2     chris  */
     72        1.9       dsl u_int initarm(void *);
     73       1.14      matt struct pmap_devmap;
     74       1.14      matt struct boot_physmem;
     75  1.21.12.2  pgoyette 
     76  1.21.12.2  pgoyette static inline paddr_t
     77  1.21.12.2  pgoyette aarch32_kern_vtophys(vaddr_t va)
     78  1.21.12.2  pgoyette {
     79  1.21.12.2  pgoyette 	return va - kern_vtopdiff;
     80  1.21.12.2  pgoyette }
     81  1.21.12.2  pgoyette 
     82  1.21.12.2  pgoyette static inline vaddr_t
     83  1.21.12.2  pgoyette aarch32_kern_phystov(paddr_t pa)
     84  1.21.12.2  pgoyette {
     85  1.21.12.2  pgoyette 	return pa + kern_vtopdiff;
     86  1.21.12.2  pgoyette }
     87  1.21.12.2  pgoyette 
     88  1.21.12.2  pgoyette #define KERN_VTOPHYS(va)	aarch32_kern_vtophys(va)
     89  1.21.12.2  pgoyette #define KERN_PHYSTOV(pa)	aarch32_kern_phystov(pa)
     90  1.21.12.2  pgoyette 
     91  1.21.12.2  pgoyette void cpu_kernel_vm_init(paddr_t, psize_t);
     92  1.21.12.2  pgoyette 
     93       1.14      matt void arm32_bootmem_init(paddr_t memstart, psize_t memsize, paddr_t kernelstart);
     94       1.14      matt void arm32_kernel_vm_init(vaddr_t kvm_base, vaddr_t vectors,
     95       1.14      matt 	vaddr_t iovbase /* (can be zero) */,
     96       1.14      matt 	const struct pmap_devmap *devmap, bool mapallmem_p);
     97       1.14      matt vaddr_t initarm_common(vaddr_t kvm_base, vsize_t kvm_size,
     98       1.14      matt         const struct boot_physmem *bp, size_t nbp);
     99       1.14      matt 
    100  1.21.12.3  pgoyette void uartputc(int);
    101        1.2     chris 
    102        1.2     chris /* from arm/arm32/intr.c */
    103        1.9       dsl void dosoftints(void);
    104        1.9       dsl void set_spl_masks(void);
    105        1.2     chris #ifdef DIAGNOSTIC
    106        1.9       dsl void dump_spl_masks(void);
    107        1.2     chris #endif
    108        1.1     chris #endif
    109