Commit 809ae1e8 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

debugging exif, added packed attribute to structures

parent cbe1a44b
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
	int p=(int)file->private_data;
	int thissize=minor_file_size(p);
	int maxsize=minor_max_size(p);
//    int fp;
    int fp;
    dev_dbg(g_devfp_ptr,"exif_lseek, minor=%d, offset = 0x%llx, orig=%d\n",p,offset,orig);
	//   int sensor_port;
	switch (orig) {
@@ -548,7 +548,9 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
			case DEV393_MINOR(DEV393_EXIF_META1):
			case DEV393_MINOR(DEV393_EXIF_META2):
			case DEV393_MINOR(DEV393_EXIF_META3):
				file->f_pos=offset*sizeof(struct exif_dir_table_t);
                fp= dir_find_tag (offset);
                if (fp < 0) return -EOVERFLOW; // tag is not in the directory
                file->f_pos=fp;
				break;
            case DEV393_MINOR(DEV393_EXIF_METADIR):
                file->f_pos=offset*sizeof(struct exif_dir_table_t);
@@ -602,8 +604,11 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
	char tmp[MAX_EXIF_SIZE]; //! Or is it possible to disable IRQ while copy_from_user()?
	unsigned long flags;
	int disabled_err=0;
    dev_dbg(g_devfp_ptr,"minor=0x%x\n", p);

	if ((*off+count)>maxsize) {
	    dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
//	    dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
        dev_dbg(g_devfp_ptr,"Data (0x%x) does not fit into 0x%x bytes, minor = 0x%x\n",(int) (*off+count), maxsize, p);
		return -EOVERFLOW;
	}
	switch (p) {
+90 −81

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -1652,7 +1652,7 @@ struct p_names_t {


// make this structure common for sensors, add fields as needed
struct sensor_t {
struct __attribute__((__packed__)) sensor_t {
// sensor constants
   unsigned long  imageWidth;     ///< nominal image width for final images
   unsigned long  imageHeight;    ///< nominal image height for final images
@@ -1789,7 +1789,7 @@ struct i2c_timing_t {

#define GAMMA_SCALE_SHIFT     10  // when scaling - shift right by GAMMA_SCALE_SHIFT (treat scale as 6.10)
#define GAMMA_SCLALE_1 ( 1 << GAMMA_SCALE_SHIFT )      // gamma scale 1.0 - 0x400
struct gamma_stuct_t {
struct __attribute__((__packed__)) gamma_stuct_t {
    union {
        unsigned long hash32; /// fully identifies current table
        struct {
+4 −4
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ or Rational or else. The generated Exif header copies that variable fileds on to

The compressed data buffer is stored in "meta pages", one per frame 
*/
struct exif_dir_table_t {
struct __attribute__((__packed__)) exif_dir_table_t {
        union {
          unsigned long ltag;// tag group and tag combined
          struct {
@@ -112,13 +112,13 @@ struct exif_dir_table_t {
//  array(0x9003,2,"2001:06:21 12:00:00","len"=> 20), //date/time original time created, always use 20 bytes (19 ."\0")
//  array(0x9291,2,"0        ") //original time sub-second length=10  9 ."\0"
///move back to interframe_params_t?
struct frame_exif_t {
struct __attribute__((__packed__)) frame_exif_t {
          unsigned short meta_index;     //! index of the linked meta page
          unsigned short signffff;       //! should be 0xffff - it will be a signature that JPEG data was not overwritten
          unsigned long  frame_length;   //! frame length
};

struct meta_GPSInfo_t {
struct __attribute__((__packed__)) meta_GPSInfo_t {
   unsigned char GPSLatitudeRef; //"N"/"S"
   unsigned long GPSLatitude_deg_nom;
   unsigned long GPSLatitude_deg_denom;
@@ -142,7 +142,7 @@ struct meta_GPSInfo_t {
   unsigned char GPSMeasureMode;
};
//hack - use
struct meta_CompassInfo_t {
struct __attribute__((__packed__)) meta_CompassInfo_t {
//   unsigned char GPSImgDirectionRef; //"M"/"T" //0x10
   unsigned long CompassDirection_nom; //0x11
   unsigned long CompassDirection_denom;
+4 −0
Original line number Diff line number Diff line
Patches from this directory are applied by 'meta-elphel393/recipes-kernel/linux/linux-xlnx' bitbake recipe. To add a new patch, append SRC_URI variable in the recipe.
Short description of the paches:

libata-eh.c.patch
	This patch is a workaround for the situation when ESATA disk connection leads to kernel panic. Consider the following execution path in driver: libata-core.c:ata_exec_internal_sg -> error during command execution leading to command timeout -> libata-core.c:ata_qc_complete (or ata_port_freeze and finally to the same function) -> libata-core.c:ata_qc_schedule_eh where qc->scsicmd is a NULL pointer by the moment. This patch may not be needed when all hardware/software issues are rectified.
Loading