Branch oldpackages for 14.07
[14.07/packages.git] / libs / libspe2 / patches / 001-remove_tls_requirement.patch
1 --- libspe2-2.3.0.old/spebase/run.c     2008-10-28 14:43:09.000000000 +0100
2 +++ libspe2-2.3.0/spebase/run.c 2008-10-28 14:44:07.000000000 +0100
3 @@ -37,6 +37,7 @@
4  #include "spebase.h"
5  #include "regs.h"
6  
7 +#if 0
8  /*Thread-local variable for use by the debugger*/
9  __thread struct spe_context_info {
10         int spe_id;
11 @@ -44,13 +45,15 @@
12         unsigned int status;
13         struct spe_context_info *prev;
14  }*__spe_current_active_context;
15 +#endif
16  
17 -
18 +#if 0
19  static void cleanupspeinfo(struct spe_context_info *ctxinfo)
20  {
21         struct spe_context_info *tmp = ctxinfo->prev;
22         __spe_current_active_context = tmp;
23  }
24 +#endif
25  
26  static int issue_isolated_exit(struct spe_context *spe)
27  {
28 @@ -69,12 +72,14 @@
29         return 0;
30  }
31  
32 +#if 0
33  static inline void freespeinfo()
34  {
35         /*Clean up the debug variable*/
36         struct spe_context_info *tmp = __spe_current_active_context->prev;
37         __spe_current_active_context = tmp;
38  }
39 +#endif
40  
41  int _base_spe_context_run(spe_context_ptr_t spe, unsigned int *entry,
42                 unsigned int runflags, void *argp, void *envp,
43 @@ -83,7 +88,9 @@
44         int retval = 0, run_rc;
45         unsigned int run_status, tmp_entry;
46         spe_stop_info_t stopinfo_buf;
47 +#if 0
48         struct spe_context_info this_context_info __attribute__((cleanup(cleanupspeinfo)));
49 +#endif
50  
51         /* If the caller hasn't set a stopinfo buffer, provide a buffer on the
52          * stack instead. */
53 @@ -146,6 +153,7 @@
54                         return -1;
55         }
56  
57 +#if 0
58         /*Leave a trail of breadcrumbs for the debugger to follow */
59         if (!__spe_current_active_context) {
60                 __spe_current_active_context = &this_context_info;
61 @@ -162,18 +170,23 @@
62         }
63         /*remember the ls-addr*/
64         __spe_current_active_context->spe_id = spe->base_private->fd_spe_dir;
65 +#endif
66  
67  do_run:
68 +#if 0
69         /*Remember the npc value*/
70         __spe_current_active_context->npc = tmp_entry;
71 +#endif
72  
73         /* run SPE context */
74         run_rc = spu_run(spe->base_private->fd_spe_dir,
75                         &tmp_entry, &run_status);
76  
77 +#if 0
78         /*Remember the npc value*/
79         __spe_current_active_context->npc = tmp_entry;
80         __spe_current_active_context->status = run_status;
81 +#endif
82  
83         DEBUG_PRINTF("spu_run returned run_rc=0x%08x, entry=0x%04x, "
84                         "ext_status=0x%04x.\n", run_rc, tmp_entry, run_status);
85 @@ -341,6 +354,8 @@
86  
87         }
88  
89 +#if 0
90         freespeinfo();
91 +#endif
92         return retval;
93  }