@@ -2,6 +2,7 @@ use std::collections::HashMap;
22use std:: path:: Path ;
33
44use eyre:: { OptionExt , Result } ;
5+ use libaosc:: arch:: get_arch_name;
56use reqwest:: Client ;
67use serde:: de:: DeserializeOwned ;
78use serde:: { Deserialize , Serialize } ;
@@ -217,42 +218,6 @@ pub async fn get_mirror_speed_score(mirror_url: &str, client: &Client) -> Result
217218 Ok ( ( result_time, download_len) )
218219}
219220
220- // AOSC OS specific architecture mapping for ppc64
221- #[ cfg( target_arch = "powerpc64" ) ]
222- #[ inline]
223- pub ( crate ) fn get_arch_name ( ) -> Option < & ' static str > {
224- let mut endian: libc:: c_int = -1 ;
225- let result;
226- unsafe {
227- result = libc:: prctl ( libc:: PR_GET_ENDIAN , & mut endian as * mut libc:: c_int ) ;
228- }
229- if result < 0 {
230- return None ;
231- }
232- match endian {
233- libc:: PR_ENDIAN_LITTLE | libc:: PR_ENDIAN_PPC_LITTLE => Some ( "ppc64el" ) ,
234- libc:: PR_ENDIAN_BIG => Some ( "ppc64" ) ,
235- _ => None ,
236- }
237- }
238-
239- /// AOSC OS specific architecture mapping table
240- #[ cfg( not( target_arch = "powerpc64" ) ) ]
241- #[ inline]
242- pub ( crate ) fn get_arch_name ( ) -> Option < & ' static str > {
243- use std:: env:: consts:: ARCH ;
244- match ARCH {
245- "x86_64" => Some ( "amd64" ) ,
246- "x86" => Some ( "i486" ) ,
247- "powerpc" => Some ( "powerpc" ) ,
248- "aarch64" => Some ( "arm64" ) ,
249- "mips64" => Some ( "loongson3" ) ,
250- "riscv64" => Some ( "riscv64" ) ,
251- "loongarch64" => Some ( "loongarch64" ) ,
252- _ => None ,
253- }
254- }
255-
256221pub fn control_window_above ( pin_pids : & [ u32 ] , enable : bool ) -> Result < ( ) > {
257222 let mut fined = false ;
258223
0 commit comments