mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
- Restore the machine independency of sys/dev/ofw/openfirm.{c,h} by
moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two arguments used here is specific to sun4v) to MD code. - In sys/dev/ofw/openfirm.h remove prototypes for unimplemented functions and unused Solaris compatibility macros.
This commit is contained in:
parent
c54e7ea989
commit
838f76c0a9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170841
@ -807,34 +807,3 @@ OF_chain(void *virt, u_int size,
|
||||
entry(0, 0, openfirmware, arg, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Extensions added for sun4v support
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This interface allows the client to safely take over the %tba by
|
||||
* the prom's service. The prom will take care of the quiescence of
|
||||
* interrupts and handle any pending soft interrupts.
|
||||
* This call also sets the MMU fault status area for the cpu.
|
||||
*/
|
||||
void
|
||||
OF_set_mmfsa_traptable(void *tba_addr, uint64_t mmfsa_ra)
|
||||
{
|
||||
static struct {
|
||||
cell_t name;
|
||||
cell_t nargs;
|
||||
cell_t nreturns;
|
||||
cell_t tba_addr;
|
||||
cell_t mmfsa_ra;
|
||||
} args = {
|
||||
(cell_t)"SUNW,set-trap-table",
|
||||
2,
|
||||
};
|
||||
|
||||
args.tba_addr = (cell_t)tba_addr;
|
||||
args.mmfsa_ra = mmfsa_ra;
|
||||
openfirmware(&args);
|
||||
}
|
||||
|
@ -74,27 +74,6 @@ typedef unsigned int phandle_t;
|
||||
#include <sys/types.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#define p1275_ptr2cell(p) ((cell_t)((uintptr_t)((void *)(p))))
|
||||
#define p1275_int2cell(i) ((cell_t)((int)(i)))
|
||||
#define p1275_uint2cell(u) ((cell_t)((unsigned int)(u)))
|
||||
#define p1275_size2cell(u) ((cell_t)((size_t)(u)))
|
||||
#define p1275_phandle2cell(ph) ((cell_t)((unsigned int)((phandle_t)(ph))))
|
||||
#define p1275_dnode2cell(d) ((cell_t)((unsigned int)((pnode_t)(d))))
|
||||
#define p1275_ihandle2cell(ih) ((cell_t)((unsigned int)((ihandle_t)(ih))))
|
||||
#define p1275_ull2cell_high(ll) (0LL)
|
||||
#define p1275_ull2cell_low(ll) ((cell_t)(ll))
|
||||
#define p1275_uintptr2cell(i) ((cell_t)((uintptr_t)(i)))
|
||||
|
||||
#define p1275_cell2ptr(p) ((void *)((cell_t)(p)))
|
||||
#define p1275_cell2int(i) ((int)((cell_t)(i)))
|
||||
#define p1275_cell2uint(u) ((unsigned int)((cell_t)(u)))
|
||||
#define p1275_cell2size(u) ((size_t)((cell_t)(u)))
|
||||
#define p1275_cell2phandle(ph) ((phandle_t)((cell_t)(ph)))
|
||||
#define p1275_cell2dnode(d) ((pnode_t)((cell_t)(d)))
|
||||
#define p1275_cell2ihandle(ih) ((ihandle_t)((cell_t)(ih)))
|
||||
#define p1275_cells2ull(h, l) ((unsigned long long)(cell_t)(l))
|
||||
#define p1275_cell2uintptr(i) ((uintptr_t)((cell_t)(i)))
|
||||
|
||||
MALLOC_DECLARE(M_OFWPROP);
|
||||
|
||||
/*
|
||||
@ -111,7 +90,6 @@ void OF_init(int (*openfirm)(void *));
|
||||
|
||||
/* Generic functions */
|
||||
int OF_test(char *);
|
||||
void OF_helloworld(void);
|
||||
void OF_printf(const char *, ...);
|
||||
|
||||
/* Device tree functions */
|
||||
@ -151,18 +129,9 @@ void OF_chain(void *, u_int,
|
||||
|
||||
/* User interface functions */
|
||||
int OF_interpret(char *, int, ...);
|
||||
#if 0
|
||||
void *OF_set_callback(void *);
|
||||
void OF_set_symbol_lookup(void *, void *);
|
||||
#endif
|
||||
|
||||
/* Time function */
|
||||
int OF_milliseconds(void);
|
||||
|
||||
/* sun4v additions */
|
||||
void OF_set_mmfsa_traptable(void *tba_addr, uint64_t mmfsa_ra);
|
||||
int OF_translate_virt(vm_offset_t va, int *valid, vm_paddr_t *physaddr, int *mode);
|
||||
vm_paddr_t OF_vtophys(vm_offset_t va);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* _OPENFIRM_H_ */
|
||||
|
@ -145,6 +145,7 @@
|
||||
|
||||
#ifndef LOCORE
|
||||
extern const char *trap_msg[];
|
||||
extern void set_mmfsa_traptable(void *, uint64_t);
|
||||
extern void trap_init(void);
|
||||
#endif
|
||||
|
||||
|
@ -473,8 +473,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
|
||||
|
||||
BVPRINTF("init_mondo_queue\n");
|
||||
init_mondo_queue();
|
||||
BVPRINTF("OF_set_mmfsa_traptable\n");
|
||||
OF_set_mmfsa_traptable(&tl0_base, mmfsa);
|
||||
BVPRINTF("set_mmfsa_traptable\n");
|
||||
set_mmfsa_traptable(&tl0_base, mmfsa);
|
||||
BVPRINTF("trap conversion\n");
|
||||
for (i = 0; i < 256; i++)
|
||||
trap_conversion[i] = 0;
|
||||
|
@ -67,6 +67,8 @@
|
||||
#include <sys/ktrace.h>
|
||||
#endif
|
||||
|
||||
#include <dev/ofw/openfirm.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_extern.h>
|
||||
@ -237,11 +239,35 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW,
|
||||
&debugger_on_signal, 0, "");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This interface allows the client to safely take over the %tba by
|
||||
* the prom's service. The prom will take care of the quiescence of
|
||||
* interrupts and handle any pending soft interrupts.
|
||||
* This call also sets the MMU fault status area for the CPU.
|
||||
*/
|
||||
void
|
||||
set_mmfsa_traptable(void *tba_addr, uint64_t mmfsa_ra)
|
||||
{
|
||||
static struct {
|
||||
cell_t name;
|
||||
cell_t nargs;
|
||||
cell_t nreturns;
|
||||
cell_t tba_addr;
|
||||
cell_t mmfsa_ra;
|
||||
} args = {
|
||||
(cell_t)"SUNW,set-trap-table",
|
||||
2,
|
||||
};
|
||||
|
||||
args.tba_addr = (cell_t)tba_addr;
|
||||
args.mmfsa_ra = mmfsa_ra;
|
||||
openfirmware(&args);
|
||||
}
|
||||
|
||||
void
|
||||
trap_init(void)
|
||||
{
|
||||
vm_paddr_t mmfsa;
|
||||
int i;
|
||||
|
||||
mmfsa = mmu_fault_status_area + (MMFSA_SIZE*curcpu);
|
||||
|
||||
@ -249,7 +275,7 @@ trap_init(void)
|
||||
set_mmfsa_scratchpad(mmfsa);
|
||||
|
||||
init_mondo_queue();
|
||||
OF_set_mmfsa_traptable(&tl0_base, mmfsa);
|
||||
set_mmfsa_traptable(&tl0_base, mmfsa);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user