[partially forced commit due to pilot error in earlier commit attempt]

{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
This commit is contained in:
des 2001-10-21 22:16:48 +00:00
parent 5c169a6b40
commit 37a9288b9d
15 changed files with 101 additions and 40 deletions

View File

@ -50,10 +50,6 @@ void cpu_halt __P((void));
void cpu_reset __P((void));
int is_physical_memory __P((vm_offset_t addr));
void swi_vm __P((void *));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
void alpha_register_pci_scsi __P((int bus, int slot, struct cam_sim *sim));
#ifdef _SYS_BUS_H_
struct resource *alpha_platform_alloc_ide_intr(int chan);

View File

@ -110,7 +110,17 @@ struct dbreg {
#ifdef _KERNEL
void restorefpstate __P((struct fpreg *));
void savefpstate __P((struct fpreg *));
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
void setregs __P((struct thread *, u_long, u_long, u_long));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* _ALPHA_REG_H_ */

View File

@ -79,9 +79,6 @@ void doreti_popl_es __P((void)) __asm(__STRING(doreti_popl_es));
void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
void doreti_popl_fs __P((void)) __asm(__STRING(doreti_popl_fs));
void doreti_popl_fs_fault __P((void)) __asm(__STRING(doreti_popl_fs_fault));
int fill_fpregs __P((struct thread *, struct fpreg *));
int fill_regs __P((struct thread *p, struct reg *regs));
int fill_dbregs __P((struct thread *p, struct dbreg *dbregs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
void i486_bzero __P((void *buf, size_t len));
void i586_bcopy __P((const void *from, void *to, size_t len));

View File

@ -143,10 +143,13 @@ struct dbreg {
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
int set_fpregs __P((struct thread *, struct fpreg *));
int set_regs __P((struct thread *p, struct reg *regs));
void setregs __P((struct thread *, u_long, u_long, u_long));
int set_dbregs __P((struct thread *p, struct dbreg *dbregs));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* !_MACHINE_REG_H_ */

View File

@ -79,9 +79,6 @@ void doreti_popl_es __P((void)) __asm(__STRING(doreti_popl_es));
void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
void doreti_popl_fs __P((void)) __asm(__STRING(doreti_popl_fs));
void doreti_popl_fs_fault __P((void)) __asm(__STRING(doreti_popl_fs_fault));
int fill_fpregs __P((struct thread *, struct fpreg *));
int fill_regs __P((struct thread *p, struct reg *regs));
int fill_dbregs __P((struct thread *p, struct dbreg *dbregs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
void i486_bzero __P((void *buf, size_t len));
void i586_bcopy __P((const void *from, void *to, size_t len));

View File

@ -143,10 +143,13 @@ struct dbreg {
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
int set_fpregs __P((struct thread *, struct fpreg *));
int set_regs __P((struct thread *p, struct reg *regs));
void setregs __P((struct thread *, u_long, u_long, u_long));
int set_dbregs __P((struct thread *p, struct dbreg *dbregs));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* !_MACHINE_REG_H_ */

View File

@ -47,10 +47,6 @@ void cpu_halt __P((void));
void cpu_reset __P((void));
int is_physical_memory __P((vm_offset_t addr));
void swi_vm __P((void *));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int ia64_running_in_simulator __P((void));
#endif /* !_MACHINE_MD_VAR_H_ */

View File

@ -58,7 +58,17 @@ struct thread;
void restorehighfp __P((struct ia64_fpreg *));
void savehighfp __P((struct ia64_fpreg *));
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
void setregs __P((struct thread *, u_long, u_long, u_long));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* _MACHINE_REG_H_ */

View File

@ -109,7 +109,6 @@ static const char rcsid[] =
#include <dev/ofw/openfirm.h>
#include <ddb/ddb.h>
#include <sys/vnode.h>
#include <fs/procfs/procfs.h>
#include <machine/sigframe.h>
int physmem = 0;
@ -842,28 +841,42 @@ Debugger(const char *msg)
/* XXX: dummy {fill,set}_[fp]regs */
int
fill_regs(struct proc *p, struct reg *regs)
fill_regs(struct thread *td, struct reg *regs)
{
return (ENOSYS);
}
int
fill_fpregs(struct proc *p, struct fpreg *fpregs)
fill_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
set_regs(struct proc *p, struct reg *regs)
fill_fpregs(struct thread *td, struct fpreg *fpregs)
{
return (ENOSYS);
}
int
set_fpregs(struct proc *p, struct fpreg *fpregs)
set_regs(struct thread *td, struct reg *regs)
{
return (ENOSYS);
}
int
set_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
set_fpregs(struct thread *td, struct fpreg *fpregs)
{
return (ENOSYS);

View File

@ -50,9 +50,5 @@ void cpu_halt __P((void));
void cpu_reset __P((void));
int is_physical_memory __P((vm_offset_t addr));
void swi_vm __P((void *));
int fill_regs __P((struct proc *, struct reg *));
int set_regs __P((struct proc *, struct reg *));
int fill_fpregs __P((struct proc *, struct fpreg *));
int set_fpregs __P((struct proc *, struct fpreg *));
#endif /* !_MACHINE_MD_VAR_H_ */

View File

@ -22,6 +22,17 @@ struct dbreg {
unsigned long junk;
};
void setregs(struct thread *, u_long, u_long, u_long);
#ifdef _KERNEL
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
void setregs __P((struct thread *, u_long, u_long, u_long));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* _POWERPC_REG_H_ */

View File

@ -109,7 +109,6 @@ static const char rcsid[] =
#include <dev/ofw/openfirm.h>
#include <ddb/ddb.h>
#include <sys/vnode.h>
#include <fs/procfs/procfs.h>
#include <machine/sigframe.h>
int physmem = 0;
@ -842,28 +841,42 @@ Debugger(const char *msg)
/* XXX: dummy {fill,set}_[fp]regs */
int
fill_regs(struct proc *p, struct reg *regs)
fill_regs(struct thread *td, struct reg *regs)
{
return (ENOSYS);
}
int
fill_fpregs(struct proc *p, struct fpreg *fpregs)
fill_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
set_regs(struct proc *p, struct reg *regs)
fill_fpregs(struct thread *td, struct fpreg *fpregs)
{
return (ENOSYS);
}
int
set_fpregs(struct proc *p, struct fpreg *fpregs)
set_regs(struct thread *td, struct reg *regs)
{
return (ENOSYS);
}
int
set_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
set_fpregs(struct thread *td, struct fpreg *fpregs)
{
return (ENOSYS);

View File

@ -45,8 +45,6 @@ struct reg;
void cpu_halt(void);
void cpu_identify(u_int clock);
void cpu_reset(void);
int fill_fpregs(struct thread *td, struct fpreg *fpregs);
int fill_regs(struct thread *td, struct reg *regs);
int is_physical_memory(vm_offset_t addr);
void swi_vm(void *v);

View File

@ -71,9 +71,13 @@ struct dbreg {
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
int set_fpregs(struct thread *td, struct fpreg *fpregs);
int set_regs(struct thread *td, struct reg *regs);
void setregs(struct thread *td, u_long e, u_long s, u_long ps);
void setregs __P((struct thread *, u_long, u_long, u_long));
int fill_regs __P((struct thread *, struct reg *));
int set_regs __P((struct thread *, struct reg *));
int fill_fpregs __P((struct thread *, struct fpreg *));
int set_fpregs __P((struct thread *, struct fpreg *));
int fill_dbregs __P((struct thread *, struct dbreg *));
int set_dbregs __P((struct thread *, struct dbreg *));
#endif
#endif /* !_MACHINE_REG_H_ */

View File

@ -596,6 +596,20 @@ set_regs(struct thread *td, struct reg *regs)
return (0);
}
int
fill_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
set_dbregs(struct thread *td, struct dbreg *dbregs)
{
return (ENOSYS);
}
int
fill_fpregs(struct thread *td, struct fpreg *fpregs)
{