Commit 840f15d3 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Add 'read_all_files' and 'read_disk' commands

parent 63bf56d0
...@@ -27,7 +27,7 @@ CFLAGS += -Wall -I$(ELPHEL_KERNEL_DIR)/include/elphel ...@@ -27,7 +27,7 @@ CFLAGS += -Wall -I$(ELPHEL_KERNEL_DIR)/include/elphel
all: $(PROGS) all: $(PROGS)
$(PROGS): $(OBJS) $(PROGS): $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -logg -pthread -o $@ $(CC) $(LDFLAGS) $^ $(LDLIBS) -logg -pthread -lm -o $@
install: $(PROGS) install: $(PROGS)
$(INSTALL) -d $(INSTDIR) $(INSTALL) -d $(INSTDIR)
$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(INSTDIR) $(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(INSTDIR)
......
...@@ -231,7 +231,7 @@ void camogm_init(camogm_state *state, char *pipe_name) ...@@ -231,7 +231,7 @@ void camogm_init(camogm_state *state, char *pipe_name)
state->rawdev.curr_pos_w = state->rawdev.start_pos; state->rawdev.curr_pos_w = state->rawdev.start_pos;
state->rawdev.curr_pos_r = state->rawdev.start_pos; state->rawdev.curr_pos_r = state->rawdev.start_pos;
state->active_chn = ALL_CHN_ACTIVE; state->active_chn = ALL_CHN_ACTIVE;
state->rawdev.mmap_size = MMAP_CHUNK_SIZE; state->rawdev.mmap_default_size = MMAP_CHUNK_SIZE;
} }
/** /**
...@@ -803,7 +803,7 @@ void camogm_set_prefix(camogm_state *state, const char * p, path_type type) ...@@ -803,7 +803,7 @@ void camogm_set_prefix(camogm_state *state, const char * p, path_type type)
D0(fprintf(debug_file, "WARNING: raw device write initiated\n")); D0(fprintf(debug_file, "WARNING: raw device write initiated\n"));
state->rawdev_op = 1; state->rawdev_op = 1;
/* debug code follows */ /* debug code follows */
state->rawdev.end_pos = 10485760; // 10 Mib state->rawdev.end_pos = 134217728;
/* end of debug code */ /* end of debug code */
} }
} }
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#define RAWDEV_START_OFFSET 1024 #define RAWDEV_START_OFFSET 1024
/** @brief Maximum length of file or raw device path */ /** @brief Maximum length of file or raw device path */
#define ELPHEL_PATH_MAX 300 #define ELPHEL_PATH_MAX 300
#define MMAP_CHUNK_SIZE 134217728 #define MMAP_CHUNK_SIZE 10485760
/** /**
* @enum state_flags * @enum state_flags
...@@ -100,8 +100,10 @@ typedef struct { ...@@ -100,8 +100,10 @@ typedef struct {
uint64_t start_pos; uint64_t start_pos;
uint64_t end_pos; uint64_t end_pos;
uint64_t curr_pos_w; uint64_t curr_pos_w;
uint64_t *disk_mmap; unsigned char *disk_mmap;
uint64_t mmap_size; uint64_t mmap_default_size;
uint64_t mmap_current_size;
uint64_t mmap_offset;
volatile uint64_t curr_pos_r; volatile uint64_t curr_pos_r;
uint64_t file_start; uint64_t file_start;
pthread_t tid; pthread_t tid;
......
This diff is collapsed.
...@@ -35,7 +35,12 @@ struct disk_idir { ...@@ -35,7 +35,12 @@ struct disk_idir {
size_t size; size_t size;
}; };
void *build_index(void *arg); struct range {
uint64_t from;
uint64_t to;
};
//void *build_index(void *arg);
void *reader(void *arg); void *reader(void *arg);
#endif /* _CAMOGM_READ_H */ #endif /* _CAMOGM_READ_H */
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