[34] | 1 | /* |
---|
| 2 | * Copyright (C) 2005 Jimi Xenidis <jimix@watson.ibm.com>, IBM Corporation |
---|
| 3 | * |
---|
| 4 | * This program is free software; you can redistribute it and/or modify |
---|
| 5 | * it under the terms of the GNU General Public License as published by |
---|
| 6 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | * (at your option) any later version. |
---|
| 8 | * |
---|
| 9 | * This program is distributed in the hope that it will be useful, |
---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | * GNU General Public License for more details. |
---|
| 13 | * |
---|
| 14 | * You should have received a copy of the GNU General Public License |
---|
| 15 | * along with this program; if not, write to the Free Software |
---|
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | */ |
---|
| 18 | |
---|
| 19 | #include <asm/config.h> |
---|
| 20 | #include <asm/processor.h> |
---|
| 21 | #include <asm/papr.h> |
---|
| 22 | #include <asm/asm-offsets.h> |
---|
| 23 | |
---|
| 24 | #define HSC .long 0x44000022 |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | /* in is unsused */ |
---|
| 28 | #define PAPR(in, out, name, func_code) \ |
---|
| 29 | _GLOBAL(name); \ |
---|
| 30 | std r3,-GPR_WIDTH(r1); \ |
---|
| 31 | li r3,func_code; \ |
---|
| 32 | HSC; \ |
---|
| 33 | ld r12,-GPR_WIDTH(r1); \ |
---|
| 34 | cmpi 0,r12,0; \ |
---|
| 35 | bne ret ## out; /* only store regs if r12 != NULL */ \ |
---|
| 36 | b ret0 |
---|
| 37 | |
---|
| 38 | ret8: std r11, 7 * GPR_WIDTH(r12) |
---|
| 39 | ret7: std r10, 6 * GPR_WIDTH(r12) |
---|
| 40 | ret6: std r9, 5 * GPR_WIDTH(r12) |
---|
| 41 | ret5: std r8, 4 * GPR_WIDTH(r12) |
---|
| 42 | ret4: std r7, 3 * GPR_WIDTH(r12) |
---|
| 43 | ret3: std r6, 2 * GPR_WIDTH(r12) |
---|
| 44 | ret2: std r5, 1 * GPR_WIDTH(r12) |
---|
| 45 | ret1: std r4, 0 * GPR_WIDTH(r12) |
---|
| 46 | nop |
---|
| 47 | ret0: blr |
---|
| 48 | |
---|
| 49 | PAPR(5, 2,papr_remove, H_REMOVE) |
---|
| 50 | PAPR(5, 1,papr_clear_mod, H_CLEAR_MOD) |
---|
| 51 | PAPR(5, 1,papr_clear_ref, H_CLEAR_REF) |
---|
| 52 | PAPR(5, 0,papr_protect, H_PROTECT) |
---|
| 53 | PAPR(1, 0,papr_eoi, H_EOI) |
---|
| 54 | PAPR(5, 1,papr_cppr, H_CPPR) |
---|
| 55 | PAPR(5, 2,papr_ipi, H_IPI) |
---|
| 56 | PAPR(5, 1,papr_ipoll, H_IPOLL) |
---|
| 57 | PAPR(5, 1,papr_xirr, H_XIRR) |
---|
| 58 | PAPR(2, 0,papr_interrupt, H_INTERRUPT) |
---|
| 59 | PAPR(5, 1,papr_logical_ci_load_64, H_LOGICAL_CI_LOAD) |
---|
| 60 | PAPR(5, 0,papr_logical_ci_store_64, H_LOGICAL_CI_STORE) |
---|
| 61 | PAPR(5, 1,papr_logical_cache_load_64, H_LOGICAL_CACHE_LOAD) |
---|
| 62 | PAPR(5, 0,papr_logical_cache_store_64, H_LOGICAL_CACHE_STORE) |
---|
| 63 | PAPR(5, 0,papr_logical_icbi, H_LOGICAL_ICBI) |
---|
| 64 | PAPR(5, 0,papr_logical_dcbf, H_LOGICAL_DCBF) |
---|
| 65 | PAPR(5, 1,papr_set_dabr, H_SET_DABR) |
---|
| 66 | PAPR(5, 1,papr_real_to_logical, H_REAL_TO_LOGICAL) |
---|
| 67 | PAPR(5, 1,papr_pci_config_read, H_PCI_CONFIG_READ) |
---|
| 68 | PAPR(5, 0,papr_pci_config_write, H_PCI_CONFIG_WRITE) |
---|
| 69 | |
---|
| 70 | PAPR(5, 1,papr_grant_logical, H_GRANT_LOGICAL) |
---|
| 71 | PAPR(1, 1,papr_accept_logical, H_ACCEPT_LOGICAL) |
---|
| 72 | PAPR(0, 2,papr_rescind_logical, H_RESCIND_LOGICAL) |
---|
| 73 | PAPR(3, 0,papr_register_vterm, H_REGISTER_VTERM) |
---|
| 74 | PAPR(4, 0,papr_vterm_partner_info, H_VTERM_PARTNER_INFO) |
---|
| 75 | PAPR(1, 0,papr_free_vterm, H_FREE_VTERM) |
---|
| 76 | |
---|
| 77 | /* Definitions for hypervisor functions. Note that we do not use the |
---|
| 78 | * first macro arg */ |
---|
| 79 | |
---|
| 80 | PAPR(x, 1,papr_enter, H_ENTER) |
---|
| 81 | PAPR(x, 8,papr_read, H_READ) |
---|
| 82 | PAPR(x, 1,papr_thread_control, H_THREAD_CONTROL) |
---|
| 83 | PAPR(x, 0,papr_cede, H_CEDE) |
---|
| 84 | |
---|
| 85 | PAPR(x, 0,papr_page_init, H_PAGE_INIT) |
---|
| 86 | PAPR(x, 1,papr_set_asr, H_SET_ASR) /* ISTAR only. */ |
---|
| 87 | PAPR(x, 0,papr_asr_on, H_ASR_ON) /* ISTAR only. */ |
---|
| 88 | PAPR(x, 0,papr_asr_off, H_ASR_OFF) /* ISTAR only. */ |
---|
| 89 | |
---|
| 90 | PAPR(x, 8,papr_hypervisor_data, H_HYPERVISOR_DATA) |
---|
| 91 | |
---|
| 92 | PAPR(x, 2,papr_get_xive, H_GET_XIVE) |
---|
| 93 | PAPR(x, 0,papr_set_xive, H_SET_XIVE) |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | PAPR(x, 0,papr_put_term_char, H_PUT_TERM_CHAR) |
---|
| 97 | PAPR(x, 3,papr_get_term_char, H_GET_TERM_CHAR) |
---|