From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0qMu-0003Zz-95 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0qMq-0005LB-T2 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:05:00 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:53932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0qMq-0005Ku-JX for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:04:56 -0400 Message-Id: <5571AC870200007800081573@mail.emea.novell.com> Date: Fri, 05 Jun 2015 13:04:55 +0100 From: "Jan Beulich" References: <5571AA3B020000780008152E@mail.emea.novell.com> In-Reply-To: <5571AA3B020000780008152E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartAB9F8277.2__=" Subject: [Qemu-devel] [PATCH 6/6] xen/pass-through: constify some static data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: xen-devel , Stefano Stabellini This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartAB9F8277.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is done indirectly by adjusting two typedefs and helps emphasizing that the respective tables aren't supposed to be modified at runtime (as they may be shared between devices). Signed-off-by: Jan Beulich --- a/qemu/upstream/hw/xen/xen_pt.h +++ b/qemu/upstream/hw/xen/xen_pt.h @@ -31,7 +31,7 @@ void xen_pt_log(const PCIDevice *d, cons /* Helper */ #define XEN_PFN(x) ((x) >> XC_PAGE_SHIFT) =20 -typedef struct XenPTRegInfo XenPTRegInfo; +typedef const struct XenPTRegInfo XenPTRegInfo; typedef struct XenPTReg XenPTReg; =20 typedef struct XenPCIPassthroughState XenPCIPassthroughState; @@ -135,11 +135,11 @@ struct XenPTReg { uint32_t data; /* emulated value */ }; =20 -typedef struct XenPTRegGroupInfo XenPTRegGroupInfo; +typedef const struct XenPTRegGroupInfo XenPTRegGroupInfo; =20 /* emul reg group size initialize method */ typedef int (*xen_pt_reg_size_init_fn) - (XenPCIPassthroughState *, const XenPTRegGroupInfo *, + (XenPCIPassthroughState *, XenPTRegGroupInfo *, uint32_t base_offset, uint8_t *size); =20 /* emulated register group information */ @@ -154,7 +154,7 @@ struct XenPTRegGroupInfo { /* emul register group management table */ typedef struct XenPTRegGroup { QLIST_ENTRY(XenPTRegGroup) entries; - const XenPTRegGroupInfo *reg_grp; + XenPTRegGroupInfo *reg_grp; uint32_t base_offset; uint8_t size; QLIST_HEAD(, XenPTReg) reg_tbl_list; --- a/qemu/upstream/hw/xen/xen_pt_config_init.c +++ b/qemu/upstream/hw/xen/xen_pt_config_init.c @@ -96,8 +96,7 @@ XenPTReg *xen_pt_find_reg(XenPTRegGroup=20 } =20 static uint32_t get_throughable_mask(const XenPCIPassthroughState *s, - const XenPTRegInfo *reg, - uint32_t valid_mask) + XenPTRegInfo *reg, uint32_t = valid_mask) { uint32_t throughable_mask =3D ~(reg->emu_mask | reg->ro_mask); =20 --=__PartAB9F8277.2__= Content-Type: text/plain; name="qemu-pt-const.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-pt-const.patch" xen/pass-through: constify some static data=0A=0AThis is done indirectly = by adjusting two typedefs and helps emphasizing=0Athat the respective = tables aren't supposed to be modified at runtime=0A(as they may be shared = between devices).=0A=0ASigned-off-by: Jan Beulich =0A=0A= --- a/qemu/upstream/hw/xen/xen_pt.h=0A+++ b/qemu/upstream/hw/xen/xen_pt.h= =0A@@ -31,7 +31,7 @@ void xen_pt_log(const PCIDevice *d, cons=0A /* Helper = */=0A #define XEN_PFN(x) ((x) >> XC_PAGE_SHIFT)=0A =0A-typedef struct = XenPTRegInfo XenPTRegInfo;=0A+typedef const struct XenPTRegInfo XenPTRegInf= o;=0A typedef struct XenPTReg XenPTReg;=0A =0A typedef struct XenPCIPassthr= oughState XenPCIPassthroughState;=0A@@ -135,11 +135,11 @@ struct XenPTReg = {=0A uint32_t data; /* emulated value */=0A };=0A =0A-typedef struct = XenPTRegGroupInfo XenPTRegGroupInfo;=0A+typedef const struct XenPTRegGroupI= nfo XenPTRegGroupInfo;=0A =0A /* emul reg group size initialize method = */=0A typedef int (*xen_pt_reg_size_init_fn)=0A- (XenPCIPassthroughState= *, const XenPTRegGroupInfo *,=0A+ (XenPCIPassthroughState *, XenPTRegGr= oupInfo *,=0A uint32_t base_offset, uint8_t *size);=0A =0A /* = emulated register group information */=0A@@ -154,7 +154,7 @@ struct = XenPTRegGroupInfo {=0A /* emul register group management table */=0A = typedef struct XenPTRegGroup {=0A QLIST_ENTRY(XenPTRegGroup) = entries;=0A- const XenPTRegGroupInfo *reg_grp;=0A+ XenPTRegGroupInfo = *reg_grp;=0A uint32_t base_offset;=0A uint8_t size;=0A = QLIST_HEAD(, XenPTReg) reg_tbl_list;=0A--- a/qemu/upstream/hw/xen/xen_pt_co= nfig_init.c=0A+++ b/qemu/upstream/hw/xen/xen_pt_config_init.c=0A@@ -96,8 = +96,7 @@ XenPTReg *xen_pt_find_reg(XenPTRegGroup =0A }=0A =0A static = uint32_t get_throughable_mask(const XenPCIPassthroughState *s,=0A- = const XenPTRegInfo *reg,=0A- = uint32_t valid_mask)=0A+ = XenPTRegInfo *reg, uint32_t valid_mask)=0A {=0A uint32_t throughabl= e_mask =3D ~(reg->emu_mask | reg->ro_mask);=0A =0A --=__PartAB9F8277.2__=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH 6/6] xen/pass-through: constify some static data Date: Fri, 05 Jun 2015 13:04:55 +0100 Message-ID: <5571AC870200007800081573@mail.emea.novell.com> References: <5571AA3B020000780008152E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartAB9F8277.1__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0qMr-0000Hr-Ik for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 12:04:57 +0000 In-Reply-To: <5571AA3B020000780008152E@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: qemu-devel@nongnu.org Cc: xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartAB9F8277.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is done indirectly by adjusting two typedefs and helps emphasizing that the respective tables aren't supposed to be modified at runtime (as they may be shared between devices). Signed-off-by: Jan Beulich --- a/qemu/upstream/hw/xen/xen_pt.h +++ b/qemu/upstream/hw/xen/xen_pt.h @@ -31,7 +31,7 @@ void xen_pt_log(const PCIDevice *d, cons /* Helper */ #define XEN_PFN(x) ((x) >> XC_PAGE_SHIFT) =20 -typedef struct XenPTRegInfo XenPTRegInfo; +typedef const struct XenPTRegInfo XenPTRegInfo; typedef struct XenPTReg XenPTReg; =20 typedef struct XenPCIPassthroughState XenPCIPassthroughState; @@ -135,11 +135,11 @@ struct XenPTReg { uint32_t data; /* emulated value */ }; =20 -typedef struct XenPTRegGroupInfo XenPTRegGroupInfo; +typedef const struct XenPTRegGroupInfo XenPTRegGroupInfo; =20 /* emul reg group size initialize method */ typedef int (*xen_pt_reg_size_init_fn) - (XenPCIPassthroughState *, const XenPTRegGroupInfo *, + (XenPCIPassthroughState *, XenPTRegGroupInfo *, uint32_t base_offset, uint8_t *size); =20 /* emulated register group information */ @@ -154,7 +154,7 @@ struct XenPTRegGroupInfo { /* emul register group management table */ typedef struct XenPTRegGroup { QLIST_ENTRY(XenPTRegGroup) entries; - const XenPTRegGroupInfo *reg_grp; + XenPTRegGroupInfo *reg_grp; uint32_t base_offset; uint8_t size; QLIST_HEAD(, XenPTReg) reg_tbl_list; --- a/qemu/upstream/hw/xen/xen_pt_config_init.c +++ b/qemu/upstream/hw/xen/xen_pt_config_init.c @@ -96,8 +96,7 @@ XenPTReg *xen_pt_find_reg(XenPTRegGroup=20 } =20 static uint32_t get_throughable_mask(const XenPCIPassthroughState *s, - const XenPTRegInfo *reg, - uint32_t valid_mask) + XenPTRegInfo *reg, uint32_t = valid_mask) { uint32_t throughable_mask =3D ~(reg->emu_mask | reg->ro_mask); =20 --=__PartAB9F8277.1__= Content-Type: text/plain; name="qemu-pt-const.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-pt-const.patch" xen/pass-through: constify some static data=0A=0AThis is done indirectly = by adjusting two typedefs and helps emphasizing=0Athat the respective = tables aren't supposed to be modified at runtime=0A(as they may be shared = between devices).=0A=0ASigned-off-by: Jan Beulich =0A=0A= --- a/qemu/upstream/hw/xen/xen_pt.h=0A+++ b/qemu/upstream/hw/xen/xen_pt.h= =0A@@ -31,7 +31,7 @@ void xen_pt_log(const PCIDevice *d, cons=0A /* Helper = */=0A #define XEN_PFN(x) ((x) >> XC_PAGE_SHIFT)=0A =0A-typedef struct = XenPTRegInfo XenPTRegInfo;=0A+typedef const struct XenPTRegInfo XenPTRegInf= o;=0A typedef struct XenPTReg XenPTReg;=0A =0A typedef struct XenPCIPassthr= oughState XenPCIPassthroughState;=0A@@ -135,11 +135,11 @@ struct XenPTReg = {=0A uint32_t data; /* emulated value */=0A };=0A =0A-typedef struct = XenPTRegGroupInfo XenPTRegGroupInfo;=0A+typedef const struct XenPTRegGroupI= nfo XenPTRegGroupInfo;=0A =0A /* emul reg group size initialize method = */=0A typedef int (*xen_pt_reg_size_init_fn)=0A- (XenPCIPassthroughState= *, const XenPTRegGroupInfo *,=0A+ (XenPCIPassthroughState *, XenPTRegGr= oupInfo *,=0A uint32_t base_offset, uint8_t *size);=0A =0A /* = emulated register group information */=0A@@ -154,7 +154,7 @@ struct = XenPTRegGroupInfo {=0A /* emul register group management table */=0A = typedef struct XenPTRegGroup {=0A QLIST_ENTRY(XenPTRegGroup) = entries;=0A- const XenPTRegGroupInfo *reg_grp;=0A+ XenPTRegGroupInfo = *reg_grp;=0A uint32_t base_offset;=0A uint8_t size;=0A = QLIST_HEAD(, XenPTReg) reg_tbl_list;=0A--- a/qemu/upstream/hw/xen/xen_pt_co= nfig_init.c=0A+++ b/qemu/upstream/hw/xen/xen_pt_config_init.c=0A@@ -96,8 = +96,7 @@ XenPTReg *xen_pt_find_reg(XenPTRegGroup =0A }=0A =0A static = uint32_t get_throughable_mask(const XenPCIPassthroughState *s,=0A- = const XenPTRegInfo *reg,=0A- = uint32_t valid_mask)=0A+ = XenPTRegInfo *reg, uint32_t valid_mask)=0A {=0A uint32_t throughabl= e_mask =3D ~(reg->emu_mask | reg->ro_mask);=0A =0A --=__PartAB9F8277.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartAB9F8277.1__=--