Skip to content

Commit

Permalink
parisc: move PDC_COPRO to its own function
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Schnelle <svens@stackframe.org>
  • Loading branch information
svenschnelle committed Mar 10, 2019
1 parent a47bbdb commit 2ab0264
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/parisc/parisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,24 @@ static int pdc_hpa(unsigned int *arg)
return PDC_BAD_OPTION;
}

static int pdc_coproc(unsigned int *arg)
{
unsigned long option = ARG1;
unsigned long *result = (unsigned long *)ARG2;

switch (option) {
case PDC_COPROC_CFG:
memset(result, 0, 32 * sizeof(unsigned long));
/* set bit per cpu in ccr_functional and ccr_present: */
result[0] = result[1] = (smp_cpus <= 1) ? 1 : (1ULL << smp_cpus) - 1;
mtctl(result[0], 10); /* initialize cr10 */
result[17] = 1; // Revision
result[18] = 19; // Model
return PDC_OK;
}
return PDC_BAD_OPTION;
}

int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS)
{
static unsigned long psw_defaults = PDC_PSW_ENDIAN_BIT;
Expand Down Expand Up @@ -843,18 +861,9 @@ int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS)
return pdc_hpa(arg);

case PDC_COPROC:
switch (option) {
case PDC_COPROC_CFG:
memset(result, 0, 32 * sizeof(unsigned long));
/* set bit per cpu in ccr_functional and ccr_present: */
result[0] = result[1] = (smp_cpus <= 1) ? 1 : (1ULL << smp_cpus) - 1;
mtctl(result[0], 10); /* initialize cr10 */
result[17] = 1; // Revision
result[18] = 19; // Model
return PDC_OK;
}
return PDC_BAD_OPTION;
case PDC_IODC: /* Call IODC functions */
return pdc_coproc(arg);

case PDC_IODC: /* Call IODC functions */
// dprintf(0, "\n\nSeaBIOS: Info PDC_IODC function %ld ARG3=%x ARG4=%x ARG5=%x ARG6=%x\n", option, ARG3, ARG4, ARG5, ARG6);
switch (option) {
case PDC_IODC_READ:
Expand Down

0 comments on commit 2ab0264

Please sign in to comment.