Commit 412297d3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (5023): Fix compilation on ppc32 architecture

There's a problem, pointed by Meelis Roos <mroos@linux.ee>, that, on ppc32 arch,
with some gcc versions (noticed with prerelease 4.1.2 20061115), compilation 
fails, due the lack of __ucmpdi2 to do the required 64-bit comparision.
This patch takes some sugestions made by Andrew Morton <akpm@osdl.org>,
Stelian Pop <stelian@popies.net> and Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 1323fbda
...@@ -90,8 +90,15 @@ MODULE_LICENSE("GPL"); ...@@ -90,8 +90,15 @@ MODULE_LICENSE("GPL");
char *v4l2_norm_to_name(v4l2_std_id id) char *v4l2_norm_to_name(v4l2_std_id id)
{ {
char *name; char *name;
u32 myid = id;
switch (id) { /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle
64 bit comparations. So, on that architecture, with some gcc variants,
compilation fails. Currently, the max value is 30bit wide.
*/
BUG_ON(myid != id);
switch (myid) {
case V4L2_STD_PAL: case V4L2_STD_PAL:
name="PAL"; break; name="PAL"; break;
case V4L2_STD_PAL_BG: case V4L2_STD_PAL_BG:
......
...@@ -662,6 +662,15 @@ typedef __u64 v4l2_std_id; ...@@ -662,6 +662,15 @@ typedef __u64 v4l2_std_id;
#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
/* FIXME:
Although std_id is 64 bits, there is an issue on PPC32 architecture that
makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
this value to 32 bits.
As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
it should work fine. However, if needed to add more than two standards,
v4l2-common.c should be fixed.
*/
/* some merged standards */ /* some merged standards */
#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
......
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