powerpc/powernv: Create OPAL sglist helper functions and fix endian issues
We have two copies of code that creates an OPAL sg list. Consolidate these into a common set of helpers and fix the endian issues. The flash interface embedded a version number in the num_entries field, whereas the dump interface did did not. Since versioning wasn't added to the flash interface and it is impossible to add this in a backwards compatible way, just remove it. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
14ad0c58d5
commit
3441f04b4b
@ -41,14 +41,14 @@ struct opal_takeover_args {
|
||||
* size except the last one in the list to be as well.
|
||||
*/
|
||||
struct opal_sg_entry {
|
||||
void *data;
|
||||
long length;
|
||||
__be64 data;
|
||||
__be64 length;
|
||||
};
|
||||
|
||||
/* sg list */
|
||||
/* SG list */
|
||||
struct opal_sg_list {
|
||||
unsigned long num_entries;
|
||||
struct opal_sg_list *next;
|
||||
__be64 length;
|
||||
__be64 next;
|
||||
struct opal_sg_entry entry[];
|
||||
};
|
||||
|
||||
@ -929,6 +929,10 @@ extern int opal_resync_timebase(void);
|
||||
|
||||
extern void opal_lpc_init(void);
|
||||
|
||||
struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
|
||||
unsigned long vmalloc_size);
|
||||
void opal_free_sg_list(struct opal_sg_list *sg);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __OPAL_H */
|
||||
|
Reference in New Issue
Block a user