Commit f689789a authored by Martin Schwidefsky's avatar Martin Schwidefsky

s390/appldata: pass parameter list pointer to appldata_asm

In preparation for CONFIG_VMAP_STACK=y move the allocation of the
struct appldata_parameter_list to the caller of appldata_asm().
Reviewed-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 346e485d
...@@ -145,6 +145,7 @@ static void appldata_work_fn(struct work_struct *work) ...@@ -145,6 +145,7 @@ static void appldata_work_fn(struct work_struct *work)
int appldata_diag(char record_nr, u16 function, unsigned long buffer, int appldata_diag(char record_nr, u16 function, unsigned long buffer,
u16 length, char *mod_lvl) u16 length, char *mod_lvl)
{ {
struct appldata_parameter_list parm_list;
struct appldata_product_id id = { struct appldata_product_id id = {
.prod_nr = {0xD3, 0xC9, 0xD5, 0xE4, .prod_nr = {0xD3, 0xC9, 0xD5, 0xE4,
0xE7, 0xD2, 0xD9}, /* "LINUXKR" */ 0xE7, 0xD2, 0xD9}, /* "LINUXKR" */
...@@ -155,7 +156,8 @@ int appldata_diag(char record_nr, u16 function, unsigned long buffer, ...@@ -155,7 +156,8 @@ int appldata_diag(char record_nr, u16 function, unsigned long buffer,
id.record_nr = record_nr; id.record_nr = record_nr;
id.mod_lvl = (mod_lvl[0]) << 8 | mod_lvl[1]; id.mod_lvl = (mod_lvl[0]) << 8 | mod_lvl[1];
return appldata_asm(&id, function, (void *) buffer, length); return appldata_asm(&parm_list, &id, function,
(void *) buffer, length);
} }
/************************ timer, work, DIAG <END> ****************************/ /************************ timer, work, DIAG <END> ****************************/
......
...@@ -40,26 +40,27 @@ struct appldata_product_id { ...@@ -40,26 +40,27 @@ struct appldata_product_id {
u16 mod_lvl; /* modification level */ u16 mod_lvl; /* modification level */
} __attribute__ ((packed)); } __attribute__ ((packed));
static inline int appldata_asm(struct appldata_product_id *id,
static inline int appldata_asm(struct appldata_parameter_list *parm_list,
struct appldata_product_id *id,
unsigned short fn, void *buffer, unsigned short fn, void *buffer,
unsigned short length) unsigned short length)
{ {
struct appldata_parameter_list parm_list;
int ry; int ry;
if (!MACHINE_IS_VM) if (!MACHINE_IS_VM)
return -EOPNOTSUPP; return -EOPNOTSUPP;
parm_list.diag = 0xdc; parm_list->diag = 0xdc;
parm_list.function = fn; parm_list->function = fn;
parm_list.parlist_length = sizeof(parm_list); parm_list->parlist_length = sizeof(*parm_list);
parm_list.buffer_length = length; parm_list->buffer_length = length;
parm_list.product_id_addr = (unsigned long) id; parm_list->product_id_addr = (unsigned long) id;
parm_list.buffer_addr = virt_to_phys(buffer); parm_list->buffer_addr = virt_to_phys(buffer);
diag_stat_inc(DIAG_STAT_X0DC); diag_stat_inc(DIAG_STAT_X0DC);
asm volatile( asm volatile(
" diag %1,%0,0xdc" " diag %1,%0,0xdc"
: "=d" (ry) : "=d" (ry)
: "d" (&parm_list), "m" (parm_list), "m" (*id) : "d" (parm_list), "m" (*parm_list), "m" (*id)
: "cc"); : "cc");
return ry; return ry;
} }
......
...@@ -58,6 +58,7 @@ struct mon_private { ...@@ -58,6 +58,7 @@ struct mon_private {
static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn) static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn)
{ {
struct appldata_parameter_list parm_list;
struct appldata_product_id id; struct appldata_product_id id;
int rc; int rc;
...@@ -67,7 +68,8 @@ static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn) ...@@ -67,7 +68,8 @@ static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn)
id.version_nr = myhdr->version; id.version_nr = myhdr->version;
id.release_nr = myhdr->release; id.release_nr = myhdr->release;
id.mod_lvl = myhdr->mod_level; id.mod_lvl = myhdr->mod_level;
rc = appldata_asm(&id, fcn, (void *) buffer, myhdr->datalen); rc = appldata_asm(&parm_list, &id, fcn,
(void *) buffer, myhdr->datalen);
if (rc <= 0) if (rc <= 0)
return rc; return rc;
pr_err("Writing monitor data failed with rc=%i\n", rc); pr_err("Writing monitor data failed with rc=%i\n", rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment