Add functions to set & get the interrupt target CPU.

This commit is contained in:
pk 2003-01-22 21:58:28 +00:00
parent 2ee2952854
commit 53c776f062
2 changed files with 44 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.62 2003/01/18 06:44:57 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.63 2003/01/22 21:58:28 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@ -245,6 +245,9 @@ void mp_resume_cpus_ddb(void);
#endif
/* msiiep.c */
void msiiep_swap_endian(int);
/* intr.c */
u_int setitr(u_int);
u_int getitr(void);
/*
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.75 2003/01/16 16:27:48 pk Exp $ */
/* $NetBSD: intr.c,v 1.76 2003/01/22 21:58:28 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@ -128,6 +128,45 @@ bogusintr(fp)
}
#endif /* DIAGNOSTIC */
/*
* Get module ID of interrupt target.
*/
u_int
getitr()
{
#if defined(MULTIPROCESSOR)
u_int v;
if (!CPU_ISSUN4M || ncpu <= 1)
return (0);
v = *((u_int *)ICR_ITR);
return (v + 8);
#else
return (0);
#endif
}
/*
* Set interrupt target.
* Return previous value.
*/
u_int
setitr(u_int mid)
{
#if defined(MULTIPROCESSOR)
u_int v;
if (!CPU_ISSUN4M || ncpu <= 1)
return (0);
v = *((u_int *)ICR_ITR);
*((u_int *)ICR_ITR) = CPU_MID2CPUNO(mid);
return (v + 8);
#else
return (0);
#endif
}
/*
* Process software network interrupts.