diff options
Diffstat (limited to 'include/asm-ia64/pal.h')
-rw-r--r-- | include/asm-ia64/pal.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index 5dd477ffb88e..2303a10ee595 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/ | 67 | #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/ |
68 | #define PAL_SHUTDOWN 40 /* enter processor shutdown state */ | 68 | #define PAL_SHUTDOWN 40 /* enter processor shutdown state */ |
69 | #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ | 69 | #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ |
70 | #define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */ | ||
70 | 71 | ||
71 | #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ | 72 | #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ |
72 | #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ | 73 | #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ |
@@ -1559,6 +1560,73 @@ ia64_pal_prefetch_visibility (s64 trans_type) | |||
1559 | return iprv.status; | 1560 | return iprv.status; |
1560 | } | 1561 | } |
1561 | 1562 | ||
1563 | /* data structure for getting information on logical to physical mappings */ | ||
1564 | typedef union pal_log_overview_u { | ||
1565 | struct { | ||
1566 | u64 num_log :16, /* Total number of logical | ||
1567 | * processors on this die | ||
1568 | */ | ||
1569 | tpc :8, /* Threads per core */ | ||
1570 | reserved3 :8, /* Reserved */ | ||
1571 | cpp :8, /* Cores per processor */ | ||
1572 | reserved2 :8, /* Reserved */ | ||
1573 | ppid :8, /* Physical processor ID */ | ||
1574 | reserved1 :8; /* Reserved */ | ||
1575 | } overview_bits; | ||
1576 | u64 overview_data; | ||
1577 | } pal_log_overview_t; | ||
1578 | |||
1579 | typedef union pal_proc_n_log_info1_u{ | ||
1580 | struct { | ||
1581 | u64 tid :16, /* Thread id */ | ||
1582 | reserved2 :16, /* Reserved */ | ||
1583 | cid :16, /* Core id */ | ||
1584 | reserved1 :16; /* Reserved */ | ||
1585 | } ppli1_bits; | ||
1586 | u64 ppli1_data; | ||
1587 | } pal_proc_n_log_info1_t; | ||
1588 | |||
1589 | typedef union pal_proc_n_log_info2_u { | ||
1590 | struct { | ||
1591 | u64 la :16, /* Logical address */ | ||
1592 | reserved :48; /* Reserved */ | ||
1593 | } ppli2_bits; | ||
1594 | u64 ppli2_data; | ||
1595 | } pal_proc_n_log_info2_t; | ||
1596 | |||
1597 | typedef struct pal_logical_to_physical_s | ||
1598 | { | ||
1599 | pal_log_overview_t overview; | ||
1600 | pal_proc_n_log_info1_t ppli1; | ||
1601 | pal_proc_n_log_info2_t ppli2; | ||
1602 | } pal_logical_to_physical_t; | ||
1603 | |||
1604 | #define overview_num_log overview.overview_bits.num_log | ||
1605 | #define overview_tpc overview.overview_bits.tpc | ||
1606 | #define overview_cpp overview.overview_bits.cpp | ||
1607 | #define overview_ppid overview.overview_bits.ppid | ||
1608 | #define log1_tid ppli1.ppli1_bits.tid | ||
1609 | #define log1_cid ppli1.ppli1_bits.cid | ||
1610 | #define log2_la ppli2.ppli2_bits.la | ||
1611 | |||
1612 | /* Get information on logical to physical processor mappings. */ | ||
1613 | static inline s64 | ||
1614 | ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping) | ||
1615 | { | ||
1616 | struct ia64_pal_retval iprv; | ||
1617 | |||
1618 | PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0); | ||
1619 | |||
1620 | if (iprv.status == PAL_STATUS_SUCCESS) | ||
1621 | { | ||
1622 | if (proc_number == 0) | ||
1623 | mapping->overview.overview_data = iprv.v0; | ||
1624 | mapping->ppli1.ppli1_data = iprv.v1; | ||
1625 | mapping->ppli2.ppli2_data = iprv.v2; | ||
1626 | } | ||
1627 | |||
1628 | return iprv.status; | ||
1629 | } | ||
1562 | #endif /* __ASSEMBLY__ */ | 1630 | #endif /* __ASSEMBLY__ */ |
1563 | 1631 | ||
1564 | #endif /* _ASM_IA64_PAL_H */ | 1632 | #endif /* _ASM_IA64_PAL_H */ |