Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#59 fix endian issues when running on ppc target

open
nobody
None
5
2006-07-17
2006-07-17
Anonymous
No

I use this patch to get basic mkudffs functionality
working on a ppc target. All of the tagSerialNum
values in the logical volume descriptor tag aren't set
up with the constant_cpu_to_le16 conversion. Also, 2
references to udf_lvd[0]->numPartitionMaps were not
accessed through the le32_to_cpu conversion:

--- udftools-1.0.0b3/mkudffs/defaults.c.orig
2006-07-17 16:38:04.857170796 -0
600
+++ udftools-1.0.0b3/mkudffs/defaults.c 2006-07-17
16:45:51.879414052 -0600
@@ -69,7 +69,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_PVD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct primaryVolDesc) - s
izeof(tag)),
},
volDescSeqNum : constant_cpu_to_le32(1),
@@ -119,7 +119,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_LVD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct logicalVolDesc) - s
izeof(tag)),
},
volDescSeqNum : constant_cpu_to_le32(2),
@@ -157,7 +157,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_VDP),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct volDescPtr) - sizeo
f(tag)),
},
volDescSeqNum : constant_cpu_to_le32(3),
@@ -192,7 +192,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_IUVD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct impUseVolDesc) - si
zeof(tag)),
},
volDescSeqNum : constant_cpu_to_le32(4),
@@ -215,7 +215,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_PD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct partitionDesc) - si
zeof(tag)),
},
volDescSeqNum : constant_cpu_to_le32(5),
@@ -242,7 +242,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_USD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct unallocSpaceDesc) -
sizeof(tag)),
},
volDescSeqNum : constant_cpu_to_le32(6),
@@ -254,7 +254,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_TD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct terminatingDesc) -
sizeof(tag)),
},
};
@@ -265,7 +265,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_LVID),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct logicalVolIntegrity
Desc) - sizeof(tag)),
},
integrityType :
constant_cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE),
@@ -295,7 +295,7 @@
{
tagIdent : constant_cpu_to_le16(0),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct sparingTable) - siz
eof(tag)),
},
sparingIdent :
@@ -387,7 +387,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_FSD),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct fileSetDesc) - size
of(tag)),
},
interchangeLvl : constant_cpu_to_le16(2),
@@ -426,7 +426,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_LVID),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct primaryVolDesc) - s
izeof(tag)),
},
icbTag :
@@ -458,7 +458,7 @@
{
tagIdent :
constant_cpu_to_le16(TAG_IDENT_LVID),
descVersion : constant_cpu_to_le16(3),
- tagSerialNum : 1,
+ tagSerialNum : constant_cpu_to_le16(1),
descCRC :
constant_cpu_to_le16(sizeof(struct primaryVolDesc) - s
izeof(tag)),
},
icbTag :
--- udftools-1.0.0b3/mkudffs/mkudffs.c.orig
2006-07-17 17:12:49.429043900 -0
600
+++ udftools-1.0.0b3/mkudffs/mkudffs.c 2006-07-17
17:18:04.483030405 -0600
@@ -250,14 +250,14 @@
if (size % offsets[PSPACE_SIZE])
size -= (size % offsets[PSPACE_SIZE]);
set_extent(disc, PSPACE, start, size);
- for (i=0; i<disc->udf_lvd[0]->numPartitionMaps;
i++)
+ for (i=0;
i<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); i++)
{
if (i == 1)

disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(0xFFFFFF
FF);
else

disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(size);
}
- for (j=0; j<disc->udf_lvd[0]->numPartitionMaps;
j++)
+ for (j=0;
j<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); j++)
{
if (j == 1)
disc->udf_lvid->sizeTable[i+j]
= cpu_to_le32(0xFFFFFFFF)
;

Erik Habbinga
InPhase Technologies
erikhabbinga at inphase-tech dot com

Discussion