]> TLD Linux GIT Repositories - packages/sheepdog.git/blob - sheepdog-x86-fixes.patch
- fix i686 build
[packages/sheepdog.git] / sheepdog-x86-fixes.patch
1 diff -urNp sheepdog-sheepdog-d659b9b.orig/include/fec.h sheepdog-sheepdog-d659b9b/include/fec.h
2 --- sheepdog-sheepdog-d659b9b.orig/include/fec.h        2015-06-07 07:55:29.000000000 +0000
3 +++ sheepdog-sheepdog-d659b9b/include/fec.h     2015-07-08 14:21:04.501517808 +0000
4 @@ -100,8 +100,10 @@ void fec_decode_buffer(struct fec *ctx,
5  
6  /* for isa-l */
7  
8 +#ifdef __x86_64__
9  void isa_decode_buffer(struct fec *ctx, uint8_t *input[], const int in_idx[],
10                        char *buf, int idx);
11 +#endif
12  
13  /*
14   * @param inpkts an array of packets (size k); If a primary block, i, is present
15 @@ -177,10 +179,12 @@ static inline void ec_encode(struct fec
16         for (int i = 0; i < p; i++)
17                 pidx[i] = ctx->d + i;
18  
19 +#ifdef __x86_64__
20         if (cpu_has_ssse3)
21                 ec_encode_data_sse(SD_EC_DATA_STRIPE_SIZE / ctx->d, ctx->d, p,
22                                    ctx->ec_tbl, (unsigned char **)ds, ps);
23         else
24 +#endif
25                 fec_encode(ctx, ds, ps, pidx, p, SD_EC_DATA_STRIPE_SIZE /
26                            ctx->d);
27  }
28 @@ -207,9 +211,11 @@ static inline void ec_destroy(struct fec
29  static inline void ec_decode_buffer(struct fec *ctx, uint8_t *input[],
30                                     const int in_idx[], char *buf, int idx)
31  {
32 +#ifdef __x86_64__
33         if (cpu_has_ssse3)
34                 isa_decode_buffer(ctx, input, in_idx, buf, idx);
35         else
36 +#endif
37                 fec_decode_buffer(ctx, input, in_idx, buf, idx);
38  }
39  #endif
40 diff -urNp sheepdog-sheepdog-d659b9b.orig/lib/fec.c sheepdog-sheepdog-d659b9b/lib/fec.c
41 --- sheepdog-sheepdog-d659b9b.orig/lib/fec.c    2015-06-07 07:55:29.000000000 +0000
42 +++ sheepdog-sheepdog-d659b9b/lib/fec.c 2015-07-08 14:20:53.744517808 +0000
43 @@ -454,8 +454,10 @@ void fec_free(struct fec *p)
44         assert(p != NULL && p->magic == (((FEC_MAGIC ^ p->d) ^ p->dp) ^
45                                          (unsigned long) (p->enc_matrix)));
46         free(p->enc_matrix);
47 +#ifdef __x86_64__
48         if (cpu_has_ssse3)
49                 free(p->ec_tbl);
50 +#endif
51         free(p);
52  }
53  
54 @@ -496,11 +498,13 @@ struct fec *fec_new(unsigned short d, un
55                 *p = 1;
56         free(tmp_m);
57  
58 +#ifdef __x86_64__
59         if (cpu_has_ssse3) {
60                 retval->ec_tbl = xmalloc(dp * d * 32);
61                 ec_init_tables(d, dp - d, retval->enc_matrix + (d * d),
62                                retval->ec_tbl);
63         } else
64 +#endif
65                 retval->ec_tbl = NULL;
66         return retval;
67  }
68 @@ -712,6 +716,7 @@ void fec_decode_buffer(struct fec *ctx,
69         }
70  }
71  
72 +#ifdef __x86_64__
73  void isa_decode_buffer(struct fec *ctx, uint8_t *input[], const int in_idx[],
74                        char *buf, int idx)
75  {
76 @@ -739,3 +744,4 @@ void isa_decode_buffer(struct fec *ctx,
77         ec_init_tables(ed, 1, cm, ec_tbl);
78         ec_encode_data_sse(len, ed, 1, ec_tbl, input, lost);
79  }
80 +#endif